问题
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