• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Check if Child Window Fully Loaded

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a child window by using window.open(...) and do some manipulation on the new window AFTER it is fully loaded. Is there a way so that the parent window can tell if the child window have finished loading? I have no control on the page loaded in the child window so I cant rely on the child window document setting some flag to true in its onload handler.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well some browsers support readyState

create a setTimeout that loops until


is true

For other browsers that do not support it, you can loop until you detect an object or JS variable on the page.

Eric
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic