AddJs Method (CLIENT)


PLB Web Only, 9.9B

 

The AddJs method loads Javascript code from a file and evaluates\executes custom javascript code that was loaded. This method allows the bulk loading of multiple Javascript functions. Once functions are loaded by AddJs, they can be used\executed using the JsRun method or the API instruction. The method uses the following format:

 

[label]

{object}.AddJs

[GIVING {return}] USING [*Url=](url}][:

 

 

[*Options=]{flags{]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A CLIENT object.

return

Optional. A Numeric Variable that returns the success or failure of the method.

url

Required. A Character String Variable or string literal that defines the javascript file to be loaded and executed.

flags
Optional. A Numeric Variable or decimal number that specifies a bit mask value that controls the behaviors of this method.

Flags Affected: OVER, ZERO

Note the following:

  1. The ZERO flag is always set when the {return} value is zero which indicates that the method execution was successful. The ZERO flag is clear if the {return} value is not zero which indicates that the method execution failed.

  2. The OVER flag is set if the {return} variable is too small to receive the numeric result.

  3. The {return} value of a zero indicates that the method sent the load action request to the client browser.

  4. The {url} string gives a link that allows a custom javascript file to be loaded. The javascript functions can then be referenced using the JsRun method of PL/B CLIENT object.

  5. The {options} value invokes special behaviors for this method as follows:


  6.  

    Value

    Meaning

    0x1

    This value causes the method to allow the same javascript file to be reloaded more than once. Otherwise, a subsequent loading of the same javascript file is ignored.

 

 

See Also: CLIENT, Client Methods, Method Syntax



PL/B Language Reference AppInstallOffLine Method (CLIENT) AppMedia Method (CLIENT)