Add to Bookmark using JS


<script language="javascript" type="text/javascript">
function addBookmark() {
bookmarkurl = document.URL;
bookmarktitle = document.title;
if (document.all)  //Check the condition for IE
window.external.AddFavorite(bookmarkurl, bookmarktitle)
else if (window.sidebar) // Check the condition for Mozilla
{
window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}
}
</script>

In the body part :
<a href="javascript:addBookmark();">Bookmark this page!</a>

Comments