PDA

View Full Version : Add to faves button...


many_tentacles
04-11-2007, 10:56 AM
I can't work out why this script does not work...


<SCRIPT LANGUAGE="javascript">

if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0")
{document.write("<p><a STYLE='cursor:hand;' onClick='window.external.AddFavorite(location.href, document.title);'>Add the HPB Travel Club website to your favorites.</a></p>")}

else
{document.write("<p style='font-size:10px;'>Press CTRL-D to bookmark the HPB Travel Club website.</p>")}

</SCRIPT>


The 'else' part of it seems to work but nothing appears when I view it in IE.

Any ideas???

Thanks

felgall
04-11-2007, 08:48 PM
That will result in a non-functional button displaying in most browsers as most are set to report themselves as IE. Test for window.external instead to identify if it is IE. Also Opera 8.5 and earlier use CTRL-T for bookmarking and not CTRL-D.