Created
June 29, 2013 10:26
-
-
Save PizzaLiu/5890661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#" title="添加到收藏夹" onclick="javascript:AddFavorite();">添加到收藏夹</a> | |
<a href="#" title="设为主页" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);">设为主页</a> | |
function AddFavorite(){ | |
var url = window.location.href,tit=document.title; | |
try{window.external.addFavorite(url, tit);} | |
catch (e){ | |
try {window.sidebar.addPanel(tit, url, "");} | |
catch (e){alert("无法自动添加到收藏夹,请 Ctrl + D 手动添加");} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment