1:实现"加入收藏"功能的代码如下:
<a href="javascript:window.external.AddFavorite('http://www.baidu.com','百度')">加入收藏</a>
如果你要实现鼠标划过时即提示是否加入收藏,只需将代码改为:
<a onmouseover="window.external.addFavorite('http://www.baidu.com','百度')" target=_self href=http://www.baidu.com>加入收藏</a>
<a style="cursor:hand" onclick="this.style.behavior='url(#default#homepage)';
this.setHomePage('http://www.baidu.com/');">
<img width=16 height=16 border=0 src="p_w_picpaths/house.png">
<u> Set as Home Page</u></a>
文字型:
<A
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://hi.baidu.com/bing2008_love/blog/')"
href="#">设为首页</a>
范例:
设为首页
例:
<map name="Map">
<area shape="rect" coords="837,12,897,30" href="javascript:window.external.AddFavorite('http://www.baidu.com','百度)">
<area shape="rect" coords="765,13,824,29" href="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.baidu.com');">
</map>
按钮型:
< input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior='url (#default#homepage)';this.setHomePage('http://www.baidu.com/');" href="#">
离开时自动提示设为首页
<body onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://www.baidu.com/')))BASEBody.setHomePage(www.baidu.com//');">
<script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.baidu.com');
}
</script>
<p align="center"><a href="http://www.baidu.com/" name="homepage"
即:<body onload="myhomepage();">
<A href="http://www.baidu.com/" ="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.baidu.com/'); " target="_blank">设为首页</A>
关闭当前窗口的功能
完整的代码为:< a href="/"onclick="javascript:window.close(); return false;">关闭窗口< /a>
<a href=bingning2008_love@163.com>电子邮箱</a>