<a href="#" οnclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.xxxxxx.com');" class="xxxxx">设为首页</a>
(特别注意:要把’这个符号换成无任何输入法状态中输入的’这个符号,否则程序无法运行)
1.文字型:
<a οnclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">设为首页</a>
2.按钮型:
<input TYPE="button" VALUE=" 设为首页 " οnclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">
3.离开时自动提示设为首页:
<body οnunlοad="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"
οnclick="myhomepage();"></a>
再将下面代码加入<body>内:
οnlοad="myhomepage();"
即:<body οnlοad="myhomepage();">
<a href="#" οnclick="window.external.AddFavorite(location.href,document.title);" class="xxxx">收藏网站</a></li>