
Originally Posted by
pjrobertson123
I can confirm what Revelation 888 said
This doesn't work in Opera >9.2 (I'm using 9.21) It just takes you to the 'bookmark' page as a link
I didn't write this script and don't particularly like the 'bookmark this' concept, the browser already has that capability. Each browser does it differently, and not all browsers expose this capability to javascript as fully as does IE. This result in Opera seems adequate to me.

Originally Posted by
chornee
Still no solutions for the sidebar thing ? I dont use any frames or anything and it uses the side bar, almost makes it worse than it not working in Firefox :(
Anyone got any ideas on a work around for this ?
See above. In FF the same basic concept holds, it does however expose the sidebar bookmark to scripting. This is an acceptable fall back, but if you want it to do nothing in FF, just replace the code for FF with:
return;
Code:
<script type="text/javascript">
/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera (v9 tested) */
function bookmarksite(title,url){
if (window.sidebar) // firefox
return;
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
It would also be a nice touch to script the link. Change this:
Code:
<a href="javascript:bookmarksite('Yahoo', 'http://www.yahoo.com');">Bookmark Yahoo</a>
to:
Code:
<script type="text/javascript">
if(document.documentElement.filters||window.opera)
document.write('<a href="javascript:bookmarksite(\'Yahoo\', \'http://www.yahoo.com\');">Bookmark Yahoo</a>');
</script>
That way only IE and Opera will see it.
Bookmarks