Serif WebPlus X4 WPX4-HFMINI-ENG-STA-1 User Manual

Product codes
WPX4-HFMINI-ENG-STA-1
Page of 347
Adding Dynamic Content
  271
 
 
 
 
Use the scrollable code window. Enter one or more HTML code 
fragments into the appropriate field. 
5. 
(Optional) If the code calls for external files, use the Add... button to 
locate them. Click the Make Linked button if you want to keep the 
file(s) separate from your site. 
6. 
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.