可能重复:
Bookmark on click using jQuery
Universal add to bookmarks script?
我在我的网站上运行了几年,但它似乎只适用于IE和firefox
<script type="text/javascript">
/* <![CDATA[ */
function Bookmark() {
title = "My Site";
url = "http://mysite.com/";
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title); }
else if(window.opera && window.print) { // Opera Hotlist
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
}
/* ]]> */<!--//--><![CDATA[//><!--
sfHover = function() {
if (!document.getElementsByTagName) return false;
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
</script>
我看了一下,似乎找不到一个“全部”是否可以做到这一点?
由于
我用这个到最后工作正常 Universal add to bookmarks script?
干杯全部