[Previous] [Next] [TOC]

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...
  2. This opens the Bookmarks window.

  3. Open the Personal Toolbar Folder, and select the Folder.
  4. Opening and selecting the folder insures that the new bookmark appears in the Personal Toolbar.

  5. Choose File > New Bookmark...
  6. This opens the Bookmark Properties dialog.

  7. In the Name field, type the name you want to appear on the toolbar.
  8. For example, if you are writing a command that opens a window, you might have a name of "Open Window."

  9. In the Location(URL) field, type the command using the form javascript:void(command). Only JavaScript methods can be used.
  10. For example, to open a window, use javascript:void(window.open(""))

    Using void ensures that the original page is left unchanged.

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

[Previous] [Next] [TOC]

Copyright © 1997 Netscape Communications Corporation