Monday, April 29, 2013

How to add a Bookmark to the Browser using Javascript


<div dir="ltr" style="text-align: left;" trbidi="on">
<script type="text/javascript">
function Add_Bookmark_Favorite(url,title)
{
 if (window.sidebar)
 { // Mozilla Firefox Bookmark
  //Make sure "Load this bookmark in the sidebar is deselected
  window.sidebar.addPanel(title, url,"");
  return false;
 }
 else if( window.external )
 { // IE Favorites
  window.external.AddFavorite( url, title);
  return false;
 }
 else if(window.opera && window.print)
 { // Opera Bookmark
  return !addToFav(url,title)
 }
}
</script>
<a href="" onclick="Add_Bookmark_Favorite('http://www.google.com/','Google')">Bookmark this link</a>

</div>

No comments:

Post a Comment

Please mention your comments.......