<a href="javascript:if(document.all){window.external.addFavorite('http://www.baidu.com/','百da
度');}else if(window.sidebar){window.sidebar.addPanel('wode百度', 'http://gyy.scsn.gov.cn','');}">
加入收藏</a>
設置爲首頁的方法爲:
<a href=# onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('URL');event.returnValue=false;">設爲首頁</a>
URL就是你要設定的網址地址
要設置當前網頁的地址爲首頁,你可以這樣:
<a href=# onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage(document.location.href);event.returnValue=false;">設爲 首頁</a>