收藏本站
<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.webjx.com','网页教学网')" title="网页教学网">收藏本站</span>
或:
<script Language="JavaScript">
function bookmarkit()
{
window.external.addFavorite('http://www.webjx.com','网页教学网')
}
if (document.all)document.write('<a href="#" onClick="bookmarkit()">加入收藏夹</a>')
</script>
通用的加入收藏夹
<script type="text/javascript">
// <![CDATA[
function bookmark(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}
// ]]>
</script>
<a href="javascript:bookmark()">加入收藏夹</a>
在IE6-7. FF2.0 OP9.0中测试通过
设为首页
<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.webjx.com');" style="CURSOR: hand">设为首页</span>
返回页首
<img src="/imgs/top.gif" onClick="javascript:document.location='#top'" style="cursor:pointer;">