Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parent.onload function within child window?

Status
Not open for further replies.

jacktripper

Programmer
Dec 5, 2001
124
US

Is there a way to tell when a parent page has been loaded? Such as a parent.onload command?

I know this is a common problem, but I'm having a dilly of a time finding a usable solution.

Details:
I have an HTML form which passed data to a PHP page, and an onClick command to open a pop-up advertisement. The PHP page actually generates a PDF document (taking a while) and therefore doesn't have a <BODY> tag where I can use an onload() function to close the child window. Somehow the child has to be able to tell when that PDF document is finished loading in the parent window, and then close itself (the child).

Any ideas?
 
IE only, you can check parent.document.readyState

cross-browser you could just have the parent set some property onload, like
<body onload="window.loaded = true;">

then from the child you can check for that property

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top