Learn Photoshop, Flash, Adobe AIR, ExtJS, jQuery, Ajax, Dojo, HTML, CSS, JavaScript, XML, Accessibility, Database, DWR, Gears, GWT, Java, JSON, MooTools, Office, Perl, PHP, Programming, Prototype, Scriptaculous and more

Want to explore your choice of video from all over world at once place! then what are you waiting for, just click, explore and learn.

Tech Video Bytes

Cross-Browser Snippet for Bookmarking the webpage

Categories: Programming
Tags:
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

Leave a Reply

Featured & Popular Articles