兼容所有浏览器关闭当前页面函数
2015-09-10 10:23
489 查看
function CloseWebPage(){ if (navigator.userAgent.indexOf("MSIE") > 0) { if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { window.opener = null; window.close(); } else { window.open('', '_top'); window.top.close(); } } else if (navigator.userAgent.indexOf("Firefox") > 0) { window.location.href = 'about:blank '; } else { window.opener = null; window.open('', '_self', ''); window.close(); } }
相关文章推荐
- Android Manifest 用法
- Android学习笔记(二九):嵌入浏览器
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 浏览器 cookie 限制
- 玩转浏览器IE7的5个顶级使用技巧
- 字符集导致的浏览器跨站脚本攻击分析
- 更改IE浏览器的图标
- 如何创建ajax对象并兼容多个浏览器
- css ie6 ie7 ff的CSS hack使用技巧
- CSS 浏览器的等宽空格问题解决
- div+CSS 兼容小摘
- 区分IE6,IE7,firefox的CSS hack
- JAVASCRIPT IE 与 FF 中兼容写法记录
- CSS hack实现 CSS完美兼容IE6/IE7/FF的通用方法
- PHP限制页面只能在微信自带浏览器访问的代码
- ASP.NET实现推送文件到浏览器的方法
- 兼容各个浏览器的技巧
- 多种浏览器清除缓存的方法小结
- Dom与浏览器兼容性说明