简体   繁体   English

javascript:window.close()和Opera

[英]javascript:window.close() and Opera

I'm using asp.net web forms. 我正在使用asp.net网络表单。 I add simple javascript function to button OnClientClick - I need to close window. 我向按钮OnClientClick添加了简单的javascript函数-我需要关闭窗口。 But this simple peace of code stop working in Opera (12.10) after form data was changed: 但是,更改表单数据后,这种简单的代码和平在Opera(12.10)中停止了工作:

    <script type="text/javascript">
        function CloseCurrentWindow(sender, args) {
            window.close(); // self.close() and this.close() act similar
        }
    </script>

Does anybody know such kind of issue (and, maybe, solution). 有谁知道这种问题(也许还有解决方案)。

Thanks! 谢谢!

After a few hours of investigation, I've figured out that currently browser Opera doesn't support window.colse() function on objects (windows) that was created using _target=blanck. 经过几个小时的调查,我发现当前的浏览器Opera不支持使用_target = blanck创建的对象(窗口)上的window.colse()函数。 Only those windows that was created using javascript can be handled by javascript, which is sad.. 可悲的是,只有使用javascript创建的窗口才能被javascript处理。

Hope in future they will change this behavior to more user-friendly (or developer-friendly) 希望将来他们可以将此行为更改为对用户更友好(或对开发人员更友好)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM