and tags on the HTML page. This is good practice because the
tags are loaded into the browser before any other part of the page is loaded, and the browser can interpret all the JavaScript code prior to loading the rest of the page. This technique ensures that the scope of global values and tests for syntax errors are available to all page objects prior to the posting of a page for users to work with.
Since the
tags are created automatically by Domino when it renders a page to the browser, the only way developers could add information to the
tags in R4.x was to include an $$HTMLHead field that held a text value with the JavaScript code. The problem with the $$HTMLHead field is that you need to write a Notes formula to return a text value, and that is usually more difficult than writing the JavaScript code itself!
The R5 Designer has a new form and page event called the JS Header. This event is where developers can insert JavaScript code that will be added between the
tags, thus eliminating the need to use $$HTMLHead fields and pass-thru HTML.
You should use the JS Header form event to do the following:
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
Since the JS Header event loads prior to the rest of the page, setting global variable values can be tricky, especially if the variable value is based on a value rendered in the page. When the page is being loaded into the browser, none of the page objects are available at the time the JS Header is being interpreted. A common practice by Domino developers is to declare global variables in the JS Header event and then set the variables in the onLoad event of the form.
This was first published in May 2000