Keep visitors coming back to your Web site by adding a bookmark link with this simple JavaScript. Visitors browsing with Internet Explorer can add your Web page to their Favorites section with just one click. Try this easy technique to encourage repeat visits to your site.
Where Did I See That Site?
Unless you're CNN or Microsoft or NetMechanic, few visitors will find you just by entering your URL address into their browser. Most will locate your site using search engines or directories or by following a link from another site.
But that method introduces a lot of variables: search engine rank can change, other sites may drop your link, or visitors may not remember what keywords they used to find you. Haven't you ever searched in vain for a particular site you found, but couldn't remember exactly how you got there?
Don't leave it to chance - or a good memory. Instead, remind visitors to bookmark your site while they're reading your content.
Set Up The JavaScript Function
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:
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.