How to handle closing of a previously opened window
<p>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.</p>

<p>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?</p>

<p>Edit:</p>

<p>Parent window:</p>

<pre><code>function someAlert() {
 alert("success");  
}
</code></pre>

<p>Child window:</p>

<pre><code>window.onunload =window.opener.someAlert();
</code></pre>
