2.8 JavaScript and the Script Weblet

The std_script weblet loads a number of external JavaScript files and initializes a number of JavaScript variables and functions used by the LANSA weblets. It should be included in the <head> section of all layouts.

The script weblet – std_script – is not visualized.

The external JavaScript files referenced are a small set of JavaScript files installed on the web server to support WAMs. These scripts are loaded into a subdirectory /script directly under the image directory. If you create your own script weblet, ensure that the scripts included in the shipped std_script weblet are included in your script weblet.

InfoPic These files are shipped minified (most whitespace removed). The non-minified versions of these files are also shipped in the same directory.

If you wish to provide your own localized versions of the JavaScript messages, make a copy of std_script_messages.min.js and translate the messages. Then edit the language specific version of the std_locale weblet and update the lweb_script_messages_file and lweb_script_messages_file_charset variables.

To add your own JavaScript files to a page or layout, Enroll your JavaScript file as a Web Images external resource. Add the external resource to the webroutine or weblet that requires it. The corresponding <script> element will be added at runtime automatically.

Notes:

     Several of the shipped weblets also include small inline JavaScript functions in the XSL.

Also see

2.8.1 Can I create my own Script Weblet?

2.8.2 How do I Format inline JavaScript for a Weblet Property?