将本段代码放在网页中:

<script language="JavaScript">
 function addfavorite(url,title){
    var fav_url = url;
	var fav_title = title;
	if (document.all && window.external){
	  window.external.AddFavorite(fav_url,fav_title);
	}else if (window.sidebar){
	  window.sidebar.addPanel(fav_title,fav_url,"");
	}else{
	  alert("浏览器不支持,请手动加入收藏夹");
	}
  }
</script>

 使用方法一:

 

<a href="javascript:addfavorite(location.href,document.title);">将本页添加到收藏夹(自动匹配当前页地址和网页标题)</a>

使用方法二:

 

<a href="javascript:addfavorite('http://www.jscode.cn','网页特效代码');">将网页特效代码站添加到收藏夹(指定网页地址和名称)</a>