Bookmark Your Page Javascript , Add to Favorites script

1. Place the following javascript in the <HEAD>…</HEAD> section of your page html source. dont forget to put <script type=”text/javascript”>…</script>

1
2
3
4
5
6
7
8
9
10
11
12
function bookmarksite(title,url){
   if (window.sidebar)
	window.sidebar.addPanel(title, url, '');
   else if(window.opera &amp;&amp; window.print){
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
   }else if(document.all)
	window.external.AddFavorite(url, title);
}

2. Place this bookmark link in your html page source between the and tags, where you want the link to appear on your page.

<a href="javascript:bookmarksite(’Joey Villas - Blog','http://www.joeyvillas.com')">Bookmark this site!</a>

DEMO

Share/Save

Go to Original Source

Leave a comment

Your email address will not be published. Required fields are marked *