javascript addBookmark 加入收藏 多瀏覽器兼容
更新時間:2009年08月15日 16:43:34 作者:
不錯的加入收藏代碼,加入了對一些常見瀏覽器的判斷,更好的體現(xiàn)用戶體驗,兼容了ie,firefox.
復(fù)制代碼 代碼如下:
function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}
相關(guān)文章
javascript權(quán)威指南 學(xué)習(xí)筆記之變量作用域分享
最近一直在看《javascript權(quán)威指南 第五版》,變量作用域這一章,看得真的有點累。不過,收獲還是多多。2011-09-09JavaScript變量中var,let和const的區(qū)別
這篇文章主要介紹了JavaScript變量中var,let和const的區(qū)別,JavaScript中一共有3種用來聲明變量的關(guān)鍵字,分別是var、let和const,文章通過圍繞主題展開對三個關(guān)鍵詞的詳細(xì)介紹,需要的朋友可以參考一下2022-09-09