跨浏览器书签/添加到收藏夹javascript [英] Cross-browser bookmark/add to favorites javascript
本文介绍了跨浏览器书签/添加到收藏夹javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有跨浏览器书签/添加到收藏夹javascript。
Is there any Cross-browser bookmark/add to favorites javascript.
搜索某些列表,但没有任何列表正在工作。
Searched for some list but none is working. Can you please suggest any ?
推荐答案
jQuery版
JavaScript(从我在某人的网站上找到的脚本修改过 - 我只是找不到该网站,因此我无法给予该人的信用):
JavaScript (modified from a script I found on someone's site - I just can't find the site again, so I can't give the person credit):
$(document).ready(function() {
$("#bookmarkme").click(function() {
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(location.href,document.title,"");
} else if(window.external) { // IE Favorite
window.external.AddFavorite(location.href,document.title); }
else if(window.opera && window.print) { // Opera Hotlist
this.title=document.title;
return true;
}
});
});
HTML:
<a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>
如果不从服务器运行它,IE将显示错误以文件形式查看时,通过JavaScript将JavaScript书签:// ...
。
完整的脚本,您可以随时从此页面购买一个(不,我'm不隶属于该网站... LOL)。
If you need a more complete script, you can always buy one from this page (No, I'm not affiliated with that site... LOL).
这篇关于跨浏览器书签/添加到收藏夹javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文