Home          welcome : Guest          Log In      
  Xpode.com Beta version

Click here to Search Article

Categories/Articles

 

Bookmark Page using Javascript

 

Submitted By:


Rohit kakria

Detail : I am working as software developer in a company. I love to enjoy life. I think "Life is that what we think".

Have you seen the word Bookmark this page or Add to favourite on websites. There is a small script trick to do this. We will have to write some code in HTML head section and call in body tag

To check the example, Please click on Bookmark this page! or Add to favourites!

Javascript code for these link is given below. Select this code and paste in header section.


<script type="text/javascript" >

      function bookmarksite(title,url)
      {

        if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
        else if(window.opera && window.print){ // If browser is opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);

        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
      }


      else if(document.all)//  If browser is ie

       window.external.AddFavorite(url, title);

      }

</script>

Now Paste this code in body section.


<a href="javascript:bookmarksite(location.href, location.href)">Bookmark
this site!</a>







Comments
Share this article   |    Print   
 
*  Name         *   Comments :ar 8) :cry: 8)
:shock: :shock: :evil: :!:
:( :idea: :lol: :x
:green: :| :question: :P
:oops: :roll: :) :o
:twisted: :wink:
*  Email          
                          (will not publish)
     
  Location           
  Website            
Enter the code *
(as shown below)