Javascript Bookmark


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function addBookmark()
  2. {
  3. var success=false;
  4.  
  5. // try each until fail
  6. try {
  7. window.external.AddFavorite(window.location, document.title);
  8. success=true;
  9. } catch(e) {}
  10.  
  11. try {
  12. window.sidebar.addPanel(document.title,location.href,'');
  13. success=true;
  14. } catch(e) {}
  15.  
  16. if(!success)
  17. {
  18. alert("Your browser does not support auto bookmarking. Press CTRL+D, or CMD+D to manually bookmark this page.");
  19. }
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.