« ICS : Plant Specialists | Main | Search Engine Spider Simulator »
Bookmark this page JavaScript
By Henrie Media Inc. | May 27, 2008
Here is a handy “Bookmark this page” JavaScript I wrote that will work in Internet Explorer, Firefox, Safari and most of the major web browser. The script will prompt the user to bookmark the page they are on. Here is what you need to use this script on your website.
Put the following code between the <head></head> tags of your webpage -
<script>
function bookmark(title,url){
if(window.sidebar)
window.sidebar.addPanel(title,url,”");
else if(window.opera && window.print){
var elem = document.createElement(’a');
elem.setAttribute(’href’,url);
elem.setAttribute(’title’,title);
elem.setAttribute(’rel’,’sidebar’);
elem.click();
}
else if(window.external)
window.external.AddFavorite(url,title);}
</script>
Put the following script in your Bookmark this page link (this can be a text or image link) -
<a href=”javascript:bookmark(’Henrie Media Inc.’,’http://www.henriemedia/’);”>Bookmark this page</a>
Make sure you change the parameters (’title’, ‘url’) to the ‘url’ you want to bookmark and the ‘title’ you want the bookmark to say. In my example the ‘url’ is “http://www.Henriemedia.com” and the ‘title’ is “Henrie Media Inc.”
That’s it! Your are off and bookmarking. Please leave a comment if you find this post to be helpful.
Print This Post
Topics: Code Library, Link Analysis, Technical Support |

July 18th, 2008 at 3:27 pm
Sorry mate, but this doesn’t work in Safari as advertised.
July 18th, 2008 at 5:16 pm
I just tried this on Safari for the PC and it worked. What version of Safari and platform are you using?
August 14th, 2008 at 2:07 pm
I just re-checked this code with Safari and it does not work. I will post a solution once I find one - or you can post one if you have one. Thank you.