Load

You use this function to load a JavaScript library into your JavaScript policy.

After you load a JavaScript library you can call its defined functions in your JavaScript policy.

The Load function has the following usage:

Load(libraryname)

where libraryname is the name of an Impact JavaScript policy, or a filename of an external JavaScript library, without the .js extension. To be able to load a library, you must first copy it over to the $IMPACT_HOME/jslib directory. After you load the library, you can call its functions by referencing their names.

Assume, for example, that your MyLibrary.js JavaScript policy has the following function defined:

function myfunc() {
  Log("Running myfunc");
}

You can load the MyLibrary policy into another JavaScript policy, and call its myfunc function using the following code:

Load("MyLibrary");
myfunc();