How can I notify the parent page when a popup has finished a load which the parent initated?

dom-events, html, javascript

Solution

you could use window.opener.<functionName> and put your notification code within that function on the parent page

Problem

My main HTML page does the following: ``` var popup = window.open(...); // Wait for popup to load popup.onload = function() { do_something(); }; popup.location = "new-page.html"; ``` I'd like `do_something` to be called when `new-page.html` is finished loading. But what I currently have doesn't work -- `do_something` is never called. How can I make this work? I only care about getting this to work in Firefox 3.5, if that makes things easier.

Original source