Return to Snippet

Revision: 36214
at November 19, 2010 09:01 by tcelestino


Initial Code
$(document).ready(function(){
$("a.fav").click(function(e){
	e.preventDefault(); 
	var bookmarkUrl = this.href;
	var bookmarkTitle = this.title;
 
	if (window.sidebar) { //for firefox
		window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
	} else if( window.external || document.all) { //for IE
		window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
	} else if(window.opera) { // for Opera
		$("a.fav").attr("href",bookmarkUrl);
		$("a.fav").attr("title",bookmarkTitle);
		$("a.fav").attr("rel","sidebar");
	} else { 
		 alert('Your browser dont support');
		 return false;
	}
});
});

Initial URL

                                

Initial Description

                                

Initial Title
add favorite browser

Initial Tags
browser, jquery

Initial Language
jQuery