How to handle closing of a previously opened window
I have a form where the user fills out stuff. Towards the end they click on a link which opens up a new window to record a video. Once they are done recording they close the window.
How can I react to the closing of the window on the first window form? I may want 开发者_如何转开发to submit the form automatically or have an ajax request started to display info etc... If this isn't possible what do you suggest?
Edit:
Parent window:
function someAlert() {
alert("success");
}
Child window:
window.onunload =window.opener.someAlert();
If you opened it with window.open, you can call
window.opener.someJavaScriptFunctionInParent();
call it with window.onunload
or right before window.close()
精彩评论