Operation Manual

Adding Dynamic Content 251
4. If the code calls for external files, use the Add button to locate them.
Click the Embed button if you want to keep the file(s) separate from your
project file.
5. Click OK to close the dialog. The code will appear on your page in the
HTML Code Fragment window.
Adding JavaScript
To source a vast array of JavaScript code, try searching for "javascript
snippets" in your favourite 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 you—they'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.
Here are some typical uses when applying code to your web pages:
Disable right-mouse click on page objects
Add a Print current page button
Add a date and time to your page
Change an object's colour when selected
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.