Arbortext Command Language > Functions by Alphabetical Listing > js_source
  
js_source
js_source (filename[, args[, private]])
This function reads and executes the JavaScript program from filename. The optional args parameter is converted from a string to an array and passed to the script in the JavaScript arguments global object. The arguments are delimited by blanks and follow the normal quoting conventions.
If the specified file name does not contain any slashes and is not found in the current directory, the js_source function searches the list of directories in the set loadpath command. The .js extension is appended to the file name if necessary.
By default, the JavaScript program is evaluated in the global shared scope, so previously defined JavaScript functions are accessible. If the optional parameter private is specified and non-zero, the expression is evaluated in a temporary scope, so global shared scope functions are not available. As a result, top-level objects (including function definitions) created during evaluation are discarded on return. The default value is false.
Example
js_source("deletetags.js")
js_source("jsdoc.js","sample.js",1)
Related Topics
source command
js command
javascript function