Jquery 添加到收藏夹
//加入收藏夹
function AddFavorite() {
var title = document.title;
var url = location.href;
if (window.sidebar) {
window.sidebar.addPanel(title, url, "");
} else if (document.all) {
window.external.AddFavorite(url, title);
} else {
return true;
}
}
<a οnclick='window.external.addFavorite("http://"+document.location.host+"/",document.title)' title="收藏本站到你的收藏夹" href="javascript:void(0)" class="favor-btn">收藏本网</a>
<a href="javascript:window.external.AddFavorite(location.href, document.title)" target="_self" class="favor-btn">收藏本页</a>
<a href="javascript:AddFavorite();" class="favor-btn">添加到收藏夹</a>
都可以,仅限IE。