I have this code: <hr><a href=": Bookmark What is a HBA?" ONCLICK='window.external.AddFavorite("http://www.tech-faq.com/hba.shtml","What is a HBA?"); return false'> Bookmark <b>What is a HBA?</b> </a> Code (markup): Which generates errors like this in my Apache error logs: Can someone please lend me a clue?
I don't know about the errors but my code is different. <a href="http://www.yoururl.com/" onclick="return external.AddFavorite(location.href, document.title)">Add to My Favorites!</a> Code (markup): But then again, it only works in IE. Perhaps this might help you. Dunno.
I changed this line of code: <hr><a href=": Bookmark What is a HBA?" Code (markup): To this: <hr><a href="" Code (markup): I no longer get the cool status bar message, but I also no longer get all of those annoying error messages. I believe that I could add the status bar message back in using an ONMOUSEOVER, but strangely it's not worth the extra line of code to me.
Here is one that puts a reminder to bookmark for Gecko, and does what you have above for IE: <script type="text/javascript"> <!-- if (navigator.appName=="Netscape") { document.write ( '<span class=\"style34\">To bookmark Page,<br> click: ' +'<b>Bookmarks | Add bookmark</b> <br>' +'or press <b>Ctrl+D</b>.</span>' ) } else if (parseInt(navigator.appVersion)>3) { document.write ('' +'<a onMouseOver="self.status=\'Bookmark this site\'" ' +' onMouseOut="self.status=\'\'" ' +' href="javascript:window.external.AddFavorite' +'(\'http://www.yoursite.com/id03.html\',' +'\'Page title Yall come back now, y\'hear\')">' +'Bookmark this Page</a>.' ) } //--> </script> Code (markup): example here, under the nav bar towards right: http://www.trsiyengar.com/
Nice code. That'll work except for those that code just enough room for "Bookmark" text and not all that text for reminding.