line
Editing a script program
line

You can create a script program, using the script editor TopPage offers. You can then insert it into your Web page.

This section contains the following topics:

Related HTML tags <SCRIPT LANGUAGE= ></SCRIPT>


Vocabulary Vocabulary script

A program written in the script language, JavaScript or VBScript (Visual Basic Script). You can write this program directly into your HTML file. The use of scripts enable you to, for example:
  • Gradually change the background color of your Web page
  • Display the current time in your Web page

Script files are small, which makes them handy and convenient. However, because they are processed only on the client side, you cannot exchange data with the provider's server.


Note Note Knowledge of script language is necessary to create scripts. Refer to other books on JavaScript or VBScript.



Opening the script editor

To open the editor for editing script:

  1. Position the cursor on the location where you want to insert a script, and select Script from the Insert menu to open the script editor:

    Script dialog box


Editing a script

To write a script program using the editor and then insert it into the Web page:

  1. Select a script language, JavaScript or VBScript, from the Language box.

  2. Write a script program between <!-- and //->. Objects and libraries that you can use freely are provided on the left side. (Click the Help button to learn how to use them.)

    The following example shows how you can write a script program:

    Example of Java script description

  3. Click the OK button to insert the script at the cursor position. A script program is indicated by the mark S mark.

    Inserted Java script

Tip Tip JavaScript is conventionally surrounded by "<!--" and "// -->" and VBScript is surrounded by "<!--" and "'-->", which enables Web browsers that support scripts to run the script, and which enables Web browsers that do not support script to ignore them.


Tip Tip To insert a script program into the header section (the section surrounded by the <HEAD> tag and the </HEAD> tag in HTML) of your Web page, select Document Properties from the Edit menu, click the Others tab, and click the Edit Script button to open the script editor. Write your script with the editor, and click the OK button to insert the script into the header section.


Tip Tip If you have your own JavaScript file (*.js), you can insert it simply by selecting the file on the Contents tab, dragging it, and dropping it onto your Web page.

If you have installed TopPage materials, you can insert sample JavaScripts. To display sample JavaScripts, click the Contents tab and select JavaScript from the upper left box. To insert one of them, select one, drag it, and drop it onto your Web page.