Page Scripts Type
Describes a new JavaScript file that the app includes inside an existing JSA page.
Script files that are included by the JSA GUI Application Framework are run from the root JSA namespace context. Scripts can interact with each other within the same app and have access to top-level functions that are defined in JSA.
The following table describes the page_scripts
block fields in the manifest.json
file.
Table 1: Page_scripts Block Fields
Field | Type | Description | Required |
---|---|---|---|
app_name | String | The name of the JSA app that you want to include the scripts in. The asterisk wildcard "*" is also supported if it is used with the page_id field. Use the wildcard to include a file on every JSA page. | Yes |
page_id | String | The page ID that includes the scripts. The asterisk wildcard character "*" is also supported if used with the app_name field. Use the wildcard to include a file on every JSA page. | Yes |
scripts | Array of String | The relative path to scripts that you want to include on the page. You can add more than one script to each page. Paths to each script must be separated by a comma. | Yes |
The following code is a sample page_scripts
block from manifest.json
:
... "page_scripts": [ { "app_name":"SEM", "page_id":"OffenseList", "scripts":["/static/js/sampleScript1.js", "/static/js/sampleScript2.js"] } ], ...