You already received your answer:
http://www.dynamicdrive.com/forums/s...ad.php?t=18067
But, the page must be live. Just in case there was another error in that thread, here is my (slightly less sloppy) version of the same thing - Remember only Opera will add a local bookmark with these scripts, FF and IE require a live page:
Demo
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Test Bookmark</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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 */
function bookmarksite(){
var title=document.title, url=window.location.href;
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
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>
</head>
<body>
<a href="javascript:bookmarksite()">Bookmark this site!</a>
</body>
</html>
Bookmarks