我有下面一段代码,目的就是想关掉页面<?php
echo "<script language='javascript'>window.opener=null; window.open('','_self'); window.close(); </script>";在ie下能正常关闭但是在firefox下,没有用,查看源代码,还是有js源代码。我发现用Php echo的js代码,在firefox下好多都这样....怎么解决
echo "<script language='javascript'>window.opener=null; window.open('','_self'); window.close(); </script>";在ie下能正常关闭但是在firefox下,没有用,查看源代码,还是有js源代码。我发现用Php echo的js代码,在firefox下好多都这样....怎么解决
在FF浏览器下面,window.close()只能关闭由脚本调用window.open()打开的窗口。
https://developer.mozilla.org/En/DOM/window.close输入about:config打开高级设置,修改下面一项的值为true才可以:
dom.allow_scripts_to_close_windows