JavaScript extension: importScript

Post any suggestions or enhancement requests about the Verj.io platform or this Forum

Moderators: Jon, Steve, Ian, Dave

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

JavaScript extension: importScript

#1

Postby AJDulk » Tue Oct 01, 2013 3:26 pm

At the moment in Server-side JavaScript you can import Java packages using importPackage. I am currently working on a library of JavaScript functions that I wish to use in various scripts. At the moment you have to import the library by adding it to the Form Properties -> Events -> JavaScript Libraries. It would be nice to make the scripts self contained, therefore to be able to import the script directly into the script without involving the form. To date I have never understood the scripts folder in the Library Business Project - maybe it would be a good place to put JavaScript libraries for use in other scripts.

Suggested API:

Code: Select all

importScript([SCRIPT_PROJECT.]SCRIPT_NAME);
e.g. importScript(LIBRARY.DATE_FUNCTIONS); or importScript(GLOBAL.PERSON_FUNCTIONS); or importScript(DATE_FUNCTIONS); assuming that LIBRARY is used as the Default Project.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Oct 03, 2013 12:49 pm

Yes, I agree, this would be a good idea. Not sure how easy it is to implement but we should take a look.
Jon
0 x


Who is online

Users browsing this forum: No registered users and 54 guests