PROGRAMMING DOMINO FOR WEB APPLICATIONS


JavaScript in HTML
Example

You can use JavaScript anywhere HTML can be placed by using the standard SCRIPT LANGUAGE tag as shown below.


Mark the code as HTML by selecting it then choosing Text - Pass-thru HTML.

Lotus Domino passes the HTML to browsers as is.

Check "Render pass through HTML in Notes" in the Form or Page Properties box to have the Notes client process the HTML. If you do not check "Render pass through HTML in Notes," the HTML appears as plain text. You can hide it using the following formula for "Hide paragraph if formula is true":


If you refer to a field, the JavaScript code must follow the field on the form.

You can embed computed fields and computed text in HTML text on a form, subform, or page.

You can place JavaScript in a URL using the "javascript:" protocol, for example:


You can run JavaScript from an agent by sending it to the browser as HTML using print statements. For example, in LotusScript:
To run an agent from JavaScript, set the href property of the location object to the URL for opening the agent. The URL can be relative to the current host. For example:
Example