Home Javascript Bookmarks Make It Easy To Bookmark Your Site
Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Make It Easy To Bookmark Your Site

This simple JavaScript code will work in Internet Explorer.

Place this section inside the <HEAD> section of your page:

In this script, you're declaring two variables and using them in a function.

  • The first variable, urlAddress, is the address of your Web page.
  • The second, pageName, is the descriptive text that you want visitors to see when they refer to their Favorites list.
  • Netscape Navigator doesn't support the window.external property, so we check first to see if the visitor is using a browser that does. If their browser doesn't support the function, they see an alert box instead.
  • The function, addToFavorites, tells the browser to save both variables so the visitor can add the information to their Favorites section.
  • Remember to replace the variable names with your own page URL and description.

Use The Function In The BODY Section

Once you have your function set up, you can refer to it anywhere in the <BODY> section of your document. The most obvious place to put it is a few lines before the content of your document.

We used one at the top of this page with a text link using this code:

Reference the function inside a form to get a different look:

That code appears on your page like this:

Bookmark this page!    

A casual visitor doing online research may find your site interesting once, but can they find it again? Use the automatic bookmark script to keep interested visitors coming back for more.


Home Javascript Bookmarks Make It Easy To Bookmark Your Site
Search MS Office A-Z   |   Search Web Pages/ Design A-Z