分享几种设为首页的代码

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


<a target=_top href="javascript:window.external.addFavorite('http://www.360hao123.com,360网址导航);">加入收藏</a>
<a  href='#' onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.360hao123.com);">设为首页</a>

鼠标指向时提示设为首页

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

<A href=http://www.360hao123.com onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.360hao123.com);" target="_blank">设为首页</A>

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

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

<script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.234la.com);
}
</script>
<p align="center"><a href=http://www.360hao123.com name="homepage"
onclick="myhomepage();"></a>

离开时自动提示设为首页

替换<body>标签为:
<body onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://www.360hao123.com)))BASEBody.setHomePage('http://www.360hao123.com/');">
 

你可能感兴趣的:(代码,职场,休闲,设为主页)