Using Null Links

 < Day Day Up > 



A null link is a placeholder href that is most often added so you can attach JavaScript behaviors to a page element. To write a null link, you may use a hash mark (#) or type javascript:; in the link field for a text or image. In most cases, the second method is preferable but either works. In some Netscape browsers, the hash mark might trigger an hourglass or spinning cursor when clicked.

On the CD-ROM 

Save the Habitat Alert34 folder from the chapter34_exercise folder to your hard drive. Define a new site. Hint: If you already have another Habitat Alert site defined, then choose the Edit Site option in the Site panel of the Site Definition drop-down menu and change the path to the Local Root folder.

start sidebar
Building a Command from the History Panel

One of the many panels contained in Dreamweaver MX is the History panel. You can open the History panel by choosing Window ® Others ® History. The panel's main purpose is to represent visually the steps taken in an opened document. By default, the History panel can show up to 50 steps. To increase (or decrease) the number of steps recorded, use the programs preferences (Edit ® Preferences ® General category) to set an alternative value. Keep in mind that more steps increases the amount of memory used by the application. To erase all the history steps in the panel, use the panel Options ® Clear History.

The slider to the left of the recorded steps is used to move back and forth within the history of the document, as shown in the following figure. To restart earlier in the document's history, set the slider back to that point and begin working in the document.


The slider moves back and forth in the page history.

You can also select one or more steps and replay them in the current document or choose to copy the steps and play them in another document. Another powerful alternative is to select one or more steps and create a Command (History Options panel ® Save as a Command). A command is a powerful macro that can remember and run a series of saved steps. Not all the steps recorded by the History panel can be saved or replayed. As shown in the following figure, the listed steps that display red Xs may not be part of the command.

click to expand
The red X means a step cannot be part of a saved command.

end sidebar

 Habitat Alert site   Let's build a null link in the Habitat Alert homepage and save it as a command. These steps presume you are working through the project exercises and have defined the project site. You can use the same in any page:

  1. Open  index.htm from the site folder. This should be your current project home page, which contains a set of text links along the bottom of the page.

  2. Select Home from the footer text.

  3. In the Link field, type javascript:;

  4. Open the History panel by choosing Window ® Others ® History. Select the step that says Make Hyperlink: javascript:;.

  5. From the panel Options menu, choose Save as Command.

  6. Name the command Make Null Link, then click OK.

  7. Select Learn from the footer text. Choose Commands ® Make Null Link. Repeat for each of the footer text selections; then save your page and close it.



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net