I currently have a list of useful webpages that I am adding to my web-page. I would like to add a link next to each URL that will add it as a bookmark in the users browser. How can I do this?
Further to this, how can I add a "Bookmark all links" button to my page ?
Bookmarking for the user isn't supported by some major browsers. You might want to just let the users do it themselves. If you insist, however, this post has some code Bookmark on click using jQuery
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("a.jQueryBookmark").click(function(e){
e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
var bookmarkUrl = this.href;
var bookmarkTitle = this.title;
if (window.sidebar) { // For Mozilla Firefox Bookmark
window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
} else if(( window.external && window.external.AddFavorite) || document.all) { // For IE Favorite
window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
} else if(window.opera) { // For Opera Browsers
$("a.jQueryBookmark").attr("href",bookmarkUrl);
$("a.jQueryBookmark").attr("title",bookmarkTitle);
$("a.jQueryBookmark").attr("rel","sidebar");
} else { // for other browsers which does not support
alert('Your browser does not support this bookmark action');
return false;
}
});
});
</script>
This Code is taken from Developersnippets!
Chrome does not support such actions, since the security level could be broken.