Javascript Bookmark This Page

This javascript will add your page to client bookmark list. Work on Internet explorer and Mozilla Firefox.

1. Type this code inside head tags

<script language="javascript">
function addBookmark(title,url) {
 
  var msg_netscape = "NetScape message";
  var msg_opera    = "This function does not work with this version of Opera.
                      Please bookmark us manually.";
  var msg_other    = "Your browser does not support automatic bookmarks.
                      Please  bookmark us manually.";
  var agt          = navigator.userAgent.toLowerCase();
 
 
  if (agt.indexOf("opera") != -1) 
  {
    if (window.opera && window.print)
    {
      return true;
    } else 
    {
      alert(msg_other);
    }
  }    
  else if (agt.indexOf("firefox") != -1) {
   window.sidebar.addPanel(title,url,"");
  } else if ((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) {
   window.external.AddFavorite(url,title); 
  } else if (agt.indexOf("netscape") != -1) {
   window.sidebar.addPanel(title,url,"")
  } else if (window.sidebar && window.sidebar.addPanel) {
   window.sidebar.addPanel(title,url,""); 
  } else alert(msg_other);
}
</script>

2. Create bookmark link

<a href="javascript:addBookmark('Article and Tutorial for newbie',
'http://www.fornewbie.com');">Bookmark Us</a>

Sample :




Bookmark Us



Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.