<!DOCTYPE html>
<html>
<body>
<a href="#" onclick="AddFavorite(window.location,document.title)" rel="sidebar">加入收藏</a>
</body>
</html>
xxxxxxxxxx
function AddFavorite(sURL, sTitle){
var sTitle='';
var sURL=location.href;
if (window.sidebar) return true;
try{
window.external.addFavorite(sURL, sTitle);
}catch(e){
alert( "加入收藏失败,请使用Ctrl+D进行添加" );
}
return false;
输入 CSS 代码……