0

Is there a way to save the current page as a bookmark when a specific button is clicked and save that page link into user account of the website "not to save into browser" as a bookmark?

I want to create this thing in html using javascript / jquery or ajax...

Is it possible?

Anuveester
  • 87
  • 1
  • 1
  • 8

1 Answers1

3

With this code you have a cross-browser solution ...

if (window.sidebar && window.sidebar.addPanel) // Mozilla Firefox Bookmark
    window.sidebar.addPanel(document.title,window.location.href,'');
else if(window.external && ('AddFavorite' in window.external)) // IE Favorite
    window.external.AddFavorite(location.href,document.title); 
else if(window.opera && window.print) // Opera Hotlist
    this.title=document.title;
else // webkit - safari/chrome
    alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.');
António Almeida
  • 9,620
  • 8
  • 59
  • 66