Page 1 of 1

Adding links to favourites?

Posted: Fri Apr 24, 2009 1:57 pm
by alex.barylski
This used to be possible in JavaScript -- I know it cause I did it close to 10 years ago. Obviously times have changed and when I google for demos none of them work. :P

I am trying to offer a link to a business on my page but optionally have that link prompt the user to create a favourite bookmark in their browser. Is this still possible?

These are links which are not the active page -- so emulating a ctrl+D won't work -- I don't want the active page bookmarked...

jQuery plugin??? :P

Cheers,
Alex

Re: Adding links to favourites?

Posted: Fri Apr 24, 2009 2:06 pm
by Benjamin
Here's some code I wrote about 5 years ago to do this. Not sure if it's outdated or not:

Code: Select all

 
<script type="text/javascript">
<!--
function addToFavorites() {
  if (window.external) {
    window.external.AddFavorite(location.href,document.title)
  } else {
    alert("Your browser doesn't support this function.\n\n  Please click OK, then press CTRL and the letter D at the same time to add this page to your favorites list manually.\n\n  If you are using the Opera browser, use CTRL and T.\n\n  Thank you for visiting!");
  }
}
 

Re: Adding links to favourites?

Posted: Fri Apr 24, 2009 2:23 pm
by John Cartwright
I believe windows.external is for IE only. A quick google reveals this jquery plugin.