[Previous] [Contents]


Chapter 15
Miscellaneous Features

Activating JavaScript Commands From the Personal Toolbar

The personal toolbar, new in Navigator 4.0, provides simplified access to links, commands, and page location information. It is located below the menu bar in the Navigator window. Besides adding links to web pages, you can add JavaScript methods that are activated when you click on their corresponding button in the toolbar. For example, you can add a method that opens a new window. To add a JavaScript method to the personal toolbar, you need to create a bookmark and define a command for that bookmark (instead of a link).

  1. In the location bar, choose Bookmarks > Edit Bookmarks. This opens the Bookmarks window.
  2. Open the Personal Toolbar Folder, and select the Folder. Opening and selecting the folder insures that the new bookmark appears in the Personal Toolbar.
  3. Choose File > New Bookmark. This opens the Bookmark Properties dialog.
  4. In the Name field, type the name you want to appear on the toolbar. For example, if you are writing a command that opens a window, you might have a name of "Open Window."
  5. In the Location(URL) field, type the command using the form javascript:void(command). Only JavaScript methods can be used. For example, to open a window, use javascript:void(window.open(""))

    Using void ensures that the original page is left unchanged.

  6. Click OK and close the Bookmarks window. A new button appears on the Personal Toolbar. Clicking the button activates the command.

[Previous] [Contents]

Last Updated: 10/22/97 11:48:18


Copyright © 1997 Netscape Communications Corporation