Return to the HTML Tips
Easy way for visitors to bookmark your Web site
From the 08.19.2003 issue of Lockergnome Webmaster Weekly . Note: In code examples I add a period after each left arrow bracket so the code can be viewed in all email programs. If you copy and paste, be sure to remove the periods or it won't work. Would you like an easy way for visitors to bookmark your Web site? You can do this in two simple steps. Add the following _JavaScript somewhere within the tags of each page in which you want to use the bookmark code: <.script type="text/_javascript"> sitetitl = "Pat Wong's Music Around The World" siteurl = "http://www.napathon.net/" function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; } } <./script> Be sure to change the values of sitetitl and siteurl to match your website's title and URL. Here's an example of how to call the above _JavaScript function: <.a href="#" onfiltered="addBookmark(sitetitl,siteurl)">Bookmark<./a>
[report a broken link by clicking here]