beautypg.com

Create null and script links, Update links automatically – Adobe Dreamweaver CS3 User Manual

Page 294

background image

DREAMWEAVER CS3

User Guide

287

Create null and script links

A null link is an undesignated link. Use null links to attach behaviors to objects or text on a page. For instance, you
can attach a behavior to a null link so that it swaps an image or displays an absolutely-positioned element (AP
element) when the pointer moves over the link.

Script links execute JavaScript code or call a JavaScript function and are useful for giving visitors additional infor-
mation about an item without leaving the current web page. Script links can also be used to perform calculations,
validate forms, or do other processing tasks when a visitor clicks a specific item.

See also

“Apply a behavior” on page 349

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

javascript:;

(the word javascript, followed by a colon, followed by a semicolon)

in the Link box.

Create a script link

1

Select text, an image, or an object in the Document window’s Design view.

2

In the Link box of the Property inspector, type

javascript:

followed by some JavaScript code or a function call.

(Do not type a space between the colon and the code or call.)

Update links automatically

Dreamweaver can update links to and from a document whenever you move or rename the document within a local
site. This feature works best when you store your entire site (or an entire self-contained section of it) on your local
disk. Dreamweaver does not change files in the remote folder until you put the local files on or check them in to the
remote server.

To make the updating process faster, Dreamweaver can create a cache file in which to store information about all the
links in your local folder. The cache file is updated invisibly as you add, change, or delete links on your local site.

Enable automatic link updates

1

Select Edit > Preferences (Windows) or Dreamweaver > Preferences (Macintosh).

2

In the Preferences dialog box, select General from the category list on the left.

3

In the Document Options section of the General preferences, select an option from the Update Links When

Moving Files pop-up menu.

Always

Automatically updates all links to and from a selected document whenever you move or rename it.

Never

Does not automatically update all links to and from a selected document when you move or rename it.

Prompt

Displays a dialog box that lists all the files affected by the change. Click Update to update the links in these

files, or click Don’t Update to leave the files unchanged.

4

Click OK.

Create a cache file for your site

1

Select Site > Manage Sites.

September 4, 2007