共计 502 个字符,预计需要花费 2 分钟才能阅读完成。
代码如下:
[php]
<script language="javascript">
function addfavor(url,title) {
if(confirm("website:"+title+"\nUrl:"+url+"\n Determine?")){
var ua = navigator.userAgent.toLowerCase();
if(ua.indexOf("msie 8")>-1){
external.AddToFavoritesBar(url,title,”);//IE8
}else{
try {
window.external.addFavorite(url, title);
} catch(e) {
try {
window.sidebar.addPanel(title, url, "");//firefox
} catch(e) {
alert("error");
}
}
}
}
return false;
}
</script>
<a href="javascript:;" onclick="javascript:addfavor(‘http://www.baymal.com’,”);">add to Favorite</a>
[/php]
正文完