<a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.xxxxxx.com');" class="xxxxx">设为首页</a>
(特别注意:要把’这个符号换成无任何输入法状态中输入的’这个符号,否则程序无法运行)
1.文字型:
<a onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">设为首页</a>
2.按钮型:
<input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">
3.离开时自动提示设为首页:
<body onunload="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(’http://www.1.com’)))BASEBody.setHomePage(’http://www.dafacai.net’);">
4.打开网页就提示是否设为主页:
<script language="javascript">
function myhomepage(){
this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(’http://www.dafacai.net’);
}
</script>
<p align="center"><a href="http:www.dafacai.net" name="homepage"
onclick="myhomepage();"></a>
再将下面代码加入<body>内:
onload="myhomepage();"
即:<body onload="myhomepage();">
<a href="#" onclick="window.external.AddFavorite(location.href,document.title);" class="xxxx">收藏网站</a></li>