-
window.close
I have a button on a form that when clicked I want to close the browser, the browser will always be IE. Here is the code I've got,
Code:
<form action="javascript:null">
<input type="button" value="Close this window" onclick="window.close();">
</form>
The problem is once the user clicks the button, IE asks for confirmation they want to close the browser, is there a way to bypass the confirmation? Any ideas?
-
No, that is built into the browser as a security measure.
-
the only way to get rid of that confirmation is if you open the window that you are closing. like a popup window. but if you didn't open that window from your page and the user did to get to your page, then the answer is no.
-
Thanks
That's about what I expected.:)
-
BTW, that javascript:null thing isn't needed, I believe. So this should work:
Code:
<form name="something">