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

查看:107
本文介绍了javascript:window.close()和Opera的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net网络表单.我向按钮OnClientClick添加了简单的javascript函数-我需要关闭窗口.但是,更改表单数据后,这种简单的代码和平就无法在Opera(12.10)中工作:

I'm using asp.net web forms. I add simple javascript function to button OnClientClick - I need to close window. But this simple peace of code stop working in Opera (12.10) after form data was changed:

    <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).

谢谢!

推荐答案

经过几个小时的调查,我发现当前的浏览器Opera不支持在对象(windows)上运行window.colse()函数.使用_target = blanck创建.

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. Only those windows that was created using javascript can be handled by javascript, which is sad..

希望将来他们会将这种行为更改为对用户更友好(或对开发人员更友好)

Hope in future they will change this behavior to more user-friendly (or developer-friendly)

这篇关于javascript:window.close()和Opera的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆