Operation Manual

Adding Dynamic Web Objects 125
Adding JavaScript
To source a vast array of JavaScript code, try searching for "javascript snippets"
in your favorite search engine. You should find many thousands of sites hosting
freely available code snippets. Most of these sites will clearly indicate what the
JavaScript will do for youthey'll also normally let you select the JavaScript
code and copy it for pasting into an HTML fragment's, object's or page's Source
window, HTML table cell or directly onto the page.
Let's look at how to add some of JavaScript (sourced or written by yourself if
you've experience of JavaScript programming).
To illustrate, compare the two pieces of example code below. A very simple
JavaScript code snippet is added to the Source window which will display the
current date on your web page. The first section of code uses the last placeholder
in the above list (<!--Page Body Start-->), the second how the code looks after a
script has replaced the placeholder.
Code showing
placeholder
Code after
added JavaScript
This example illustrates where simple code is placed in a source window.
To attach code to an HTML fragment or object:
1. Select an existing HTML fragment or object.
2. From the Format menu, select Attach HTML....
- or -
Right-click on the object and choose the same option.