May 8, 2007
Cross-Browser Snippet for Bookmarking the webpage
Categories: Programming
Tags: JavaScript
Written By: admin
Below is the code which is written in JavaScript, we can use this script for bookmarking the particular webpage from your page. This code is compatible and can be reused with in your JS script.
Its simple and easy to add the stuff into your webpage.
/* Bookmark Function */
function addBookmark()
{
var url= location.href; /* this is for bookmarking the current page, if possible you can provide your own URL like (var url = "http://www.developersnippets.com";) */
bookmarkurl = url;
bookmarktitle="Developer Snippets";
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
else if ( window.sidebar ) {
window.sidebar.addPanel(bookmarktitle, bookmarkurl,"");
}
}
Place the above code in the <script> tag, and call the function as required.
Please click on the below link, to download the sample example.
>> Bookmark







