Closing a window after form submission.
I am trying to come up with a way to close a window immediately after a form in that window is submitted. I do not want to wait for the response from the server. The reason is that the response could take up to an hour and I don't want to have users waiting. Is this possible with jQuery?
Here is what I am doing now:
- <script type="text/javascript">
- function xSubmit (frm) {
- frm.submit();
- alert("The request has been submitted.");
- window.close();
- return false;
- }
- </script>
-
<form method=post action="_action_" onsubmit="return xSubmit(this);">
This only works in IE and Firefox. I am hoping to come up with an alternative using jQuery that will work in IE, Firefox and Safari.
Any help would be greatly appreciated.