The most familiar kinds of links are links to documents and named anchors (described in Linking to a document and Linking to a named anchor, respectively), but there are other types of links as well.
E-mail links open new message windows (using the mail program associated with the user's browser) whenever the user clicks them. The To field in the Message window is automatically filled in with the address specified in the link.
To create an e-mail link:
1 | Select text or an image in the Document window. |
2 | In the Property inspector, type mailto: followed by an e-mail address in the Link box. |
3 | Press Enter. |
![]() |
Nowhere links do exactly what their name implies: they go nowhere. Such links are useful for gaining access to JavaScript events that are available to links but not to text or images without sending the user away from the current page. For example, in most browsers images do not recognize the onMouseOver
event. For this reason, you must wrap images in nowhere links to implement rollover highlights (the Swap Image behavior in Dreamweaver does this automatically).
To create a nowhere link:
1 | Select text or an image in the Document window. |
2 | In the Property inspector, type a pound sign (#) in the Link box. |
3 | Press Enter. |
![]() |
Script links execute JavaScript code or call a JavaScript function and are useful for giving users additional information about an item without leaving the current page. Script links can also be used to perform calculations, form validations, and other processing tasks when a user clicks a specific item.
To create a script link:
1 | Select text or an image in the Document window. |
2 | In the Link box of the Property inspector, type javascript: followed by some JavaScript code or a function call. |
For example, typing javascript:alert(`This feature is not implemented') in the Link box produces a link that displays a JavaScript alert box with the message This feature is not implemented. |
|
Note: Because the JavaScript code appears 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 preceeding them with backslashes (for example, \"This feature is not implemented\"). |
|
![]() |