本文介绍了window.close()javascript无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
function fnConfirm() { var answer = confirm("really want to close the window"); if (answer) { window.close(); } else { }
和关闭按钮事件
and on close button event
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "xx", "<script>fnConfirm();</script>");但问题在于,只有确认框弹出,然后单击确定",没有任何反应, 提交此问题的解决方案后,请告诉我如何仅关闭打开窗口的选项卡,如果已经打开了许多选项卡,则不关闭浏览器. 在此先感谢
but the problem is that, only confirmation box pop ups and on click ok nothing happens, and after submitting the solution of this problem please tell me how to close only the Tab in which the window is opened, not browser if there are many tabs opened already. thanks in advance
推荐答案我有解决方法.. 问题不在于代码,Mozilla firefox不允许用户关闭脚本窗口. 但我们可以更改配置 1.在地址栏中输入about:config并输入. 2.确保您的"dom.allow_scripts_to_close_windows"为真 如果不是,则将其更改为true. 现在脚本可以在Mozilla firefox上正常工作. i got solution.. problem is not with the code, Mozilla firefox does not allow users to close window on script. but we can change configuration 1. type about:config in address bar and enter. 2. make sure your "dom.allow_scripts_to_close_windows" is true if not then change it to true. now scripts work fine on Mozilla firefox.
更多推荐
window.close()javascript无法正常工作
发布评论