There may be some difficulty getting this to work inside a frameset. This version overcomes that problem. As before, any apostrophes in the title need to be escaped with backslashes.
Code:
<script type="text/javascript">
sidebarurl = "http://www.jesus.org.uk/sidebar.htm"; // Change as required
sidebartitle = "Jesus Army pages"; // Change as required
if (window.sidebar && window.sidebar.addPanel) {
document.write('<a href = "#" onClick="window.sidebar.addPanel(\''+sidebartitle+'\', \''+sidebarurl+'\',\'\');return false;">Bookmark Site</a>');
}
else if (document.all) {
document.write('<a href = "#" onClick="window.external.AddFavorite(location.href, document.title);return false;">Add to Favorites</a>');
}
else if (window.opera && window.print) {
document.write('<a href = "'+sidebarurl+'" title="'+sidebartitle+'" rel="sidebar">Bookmark Site</a>');
}
else if (navigator.appName=="Netscape") {
document.write('<a href = "#" onClick="alert(\'Please click OK, then press <Ctrl-D> to bookmark this page.\');return false;">Bookmark this page</a>');
}
</script>
Google Chrome seems to think it is a Netscape browser in this code, and works OK.
Bookmarks