Posted By

JamesFillingham on 10/19/10


Tagged

bookmarket favourites


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

JamesFillingham
wirenaught
guido


Javascript Bookmark


 / Published in: JavaScript
 

  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  

You need to login to post a comment.