demo
jQuery.fn.addFavorite = function(l, h) {
return this.click(function() {
var t = jQuery(this);
if(jQuery.browser.msie) {
window.external.addFavorite(h, l);
} else if (jQuery.browser.mozilla || jQuery.browser.opera) {
t.attr("rel", "sidebar");
t.attr("title", l);
t.attr("href", h);
} else {
alert("请使用Ctrl+D将本页加入收藏夹!");
}
});
};
$(function(){
$('#fav').addFavorite(document.title,location.href);
});
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。