兼容IE和fireFox的设为首页、加入收藏JS代码
来源:互联网 发布:男生淘宝网名昵称大全 编辑:程序博客网 时间:2024/06/06 05:35
<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;mso-font-charset:1;mso-generic-font-family:roman;mso-font-format:other;mso-font-pitch:variable;mso-font-signature:0 0 0 0 0 0;}@font-face{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;mso-font-charset:0;mso-generic-font-family:swiss;mso-font-pitch:variable;mso-font-signature:-1610611985 1073750139 0 0 159 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-unhide:no;mso-style-qformat:yes;mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:"Calibri","sans-serif";mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-font-kerning:1.0pt;}.MsoChpDefault{mso-style-type:export-only;mso-default-props:yes;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:612.0pt 792.0pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:36.0pt;mso-footer-margin:36.0pt;mso-paper-source:0;}div.Section1{page:Section1;}-->
<!–/设为首页 加入收藏 兼容Firefox IE–>
<script language=”javascript” type=”text/javascript”>
function addCookie() { // 加入收藏
if (document.all) {
window.external.addFavorite(‘http://www.***.com’, ‘***网站’);
}
else if (window.sidebar) {
window.sidebar.addPanel(‘*****网站’,'http://www.***.com’, “”);
}
} functionsetHomepage() { // 设为首页
if (document.all) {
document.body.style.behavior = ‘url(#default#homepage)’;
document.body.setHomePage(‘http://www.***.com’); }
else if (window.sidebar) {
if (window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege(“UniversalXPConnect”);
}
catch (e) {
alert(“该操作被浏览器拒绝,假如想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support值该为true”);
}
}
var prefs =Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref(‘browser.startup.homepage’,'http://www.finalcn.com’);
} }
</script>
上面的代码放在网页的头部。
下面是引用代码:
<a href=“javascript:void(0)”onclick=”setHomepage()”>设为首页</a> | <ahref=”javascript:void(0)” onclick=”addCookie()”>加入收藏</a>
- 兼容IE和fireFox的设为首页、加入收藏JS代码
- 兼容ie,火狐的设为首页,加入收藏js代码
- javascript: 加入收藏 设为首页 功能 兼容Firefox和IE
- 兼容IE、FF的设为首页,加入收藏代码
- 兼容IE,FF的设为首页与加入收藏代码
- 完美兼容IE,chrome,ff的设为首页、加入收藏及保存到桌面js代码
- 完美兼容IE,chrome,ff的设为首页、加入收藏及保存到桌面js代码
- 兼容各浏览器的js加入收藏,设为首页代码
- “设为首页”和“加入收藏”功能的兼容代码
- 设为首页加入收藏代码_兼容各浏览器ie系列Firefox
- 设为首页加入收藏代码_兼容各浏览器ie系列Firefox
- 兼容各种浏览器的‘设为首页’和‘加入收藏’的js代码
- 设为首页和加入收藏(js代码)
- 设为首页,和加入收藏js代码
- 通用JS加入收藏,设为首页,兼容IE,FF
- 设为首页|加入收藏(ie,f f兼容代码)
- 设为首页和加入收藏的HTML js代码
- JS设为首页和加入收藏的代码
- 使用jQuery的load(url)加载网页的替代方案--不用考虑编码的问题
- 高斯分布函数解析
- CSS 命名规范
- 得到主键表,外键表,和外键名
- 2009-2010学年第二学期形势与政策课考查安排
- 兼容IE和fireFox的设为首页、加入收藏JS代码
- 谷歌、英特尔、索尼Web TV一触即发
- Silverlight Toolkit DataGrid - 单元格内容对齐样式
- 【asp.net】代码中尖括号和百分号的含义
- 通过/etc/inittab文件进行初始化
- 使用Visual Studio Development Server开发域验证程序时出现HTTP Error 403 - Forbidden错误的解决办法
- .NET程序员常用类库总结
- 五大最受欢迎的BUG管理系统
- python中os.system()和os.popen()的返回值