javascript:window.close() and Opera

▼魔方 西西 提交于 2019-12-11 05:41:15

问题


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

Thanks!


回答1:


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)



来源:https://stackoverflow.com/questions/12618674/javascriptwindow-close-and-opera

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!