Link to home
Start Free TrialLog in
Avatar of hungoveragain
hungoveragain

asked on

Javascript Add to Bookmarks link

Can someone please let me know how I can get the following script to work in chrome?

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

<a href="#" onclick="Javascript:bookmark('http://www.mysite.com/', 'Some Title')"><img alt="Add to favorites" src="http://www.myslte.com/images/favorites_bookmark.png" height="20" width="20"></a>

it works fine in firefox and IE.

Thanks

Mike
SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial