How to use bookmark script in your html page

Monday, March 9, 2009 0 comments


In this post you will learn how to use bookmark script in your html page. It is very easy to use bookmark script here are the simple steps to follow:

Step 1: Add the code given below in the <head> section of your website.

<script type=”text/javascript”>
function bookmarksite(title,url){

if (window.sidebar) // firefox

window.sidebar.addPanel(title, url, “”);

else if(window.opera && window.print){ // opera


var elem = document.createElement(’a');

elem.setAttribute(’href’,url);

elem.setAttribute(’title’,title);

elem.setAttribute(’rel’,’sidebar’);


elem.click();

}

else if(document.all)// ie

window.external.AddFavorite(url, title);

}

</script>
Step 2: Create an image or text link and for the href attribute use this code

javascript:bookmarksite(’title_of_site’, ‘url_of_site’)



Its done now!


Grab this Widget ~ Blogger Accessories