Linking and Navigation > Creating links > Creating null and script links |
Creating null and script links
The most familiar kinds of links are those to documents and named anchors (described in Linking documents using the Property inspector and the Point-to-File icon and Linking to a specific place within a document, respectively), but there are other types of links as well.
A null link is an undesignated link. Use null links to attach behaviors to objects or text on a page. Once you have created a null link, you can attach a behavior to it to swap an image or to display a layer when the pointer is moved over the link. For information about attaching behaviors to objects, see Attaching a behavior.
Script links execute JavaScript code or call a JavaScript function and are useful for giving visitors additional information about an item without leaving the current Web page. Script links can also be used to perform calculations, form validations, and other processing tasks when a visitor clicks a specific item.
To create a null link:
1 | Select text, an image, or an object in the Document window's Design view. |
2 | In the Property inspector, type a number sign (#) in the Link field. |
To create a script link:
1 | Select text, an image, or an object in the Document window's Design view. |
2 | In the Link field of the Property inspector, type javascript: followed by some JavaScript code or a function call. |
For example, typing javascript:alert('This link leads to the index') in the Link field produces a link that, when clicked, displays a JavaScript alert box with the message This link leads to the index . |
|
Note: Because the JavaScript code appears in the HTML between double quotation marks (as the value of the href attribute), you must use single quotation marks in the script code or "escape" any double quotation marks by preceding them with a backslash (for example, \"This link leads to the index\" ). |
|