当前位置: 首页 > 图文教程 > 网络编程 > Javascript > Firefox window.close()的使用注意事项

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 Firefox window.close()的使用注意事项


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 425 ::
收藏到网摘: n/a

window.close()在IE下可以执行关闭,但在Firefox下不关闭,不是JS代码window.close()的问题,而是Firefox的配置问题 解决方法如下:
在Firefox地址栏里输入 about:config
在配置列表中找到dom.allow_scripts_to_close_windows
点右键的选切换把上面的false修改为true即可。
注:默认是false,是为了防止脚本乱关窗口
当然,如果是通过window.open打开的窗口,是可以关闭的。
最好的兼容多浏览器的关闭方法,本站以前也有更新
http://www.ruanchen.com/rticle/16788.htm