Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1683 Is there any way for a parent window to check if a child window has fully loaded?

You are here: irt.org | FAQ | JavaScript | Window | Q1683 [ previous next ]

In Internet Explorer 4+ use readyState:

<script language="JavaScript"><!--
function checkPage() {
  if (windowReference.document.readyState == 'complete') {
    alert('Done')
    return;
  }
  setTimeout('checkPage()',100);
}

var windowReference = window.open('popup.htm','WindowName');

setTimeout('checkPage()',100);
//--></script>

For Netscape Navigator you could create your own readyState from within the popup.htm window, which complements the above:

<html>

<head>
<script language="JavaScript"><!--
document.readyState = 'not complete';
//--></script>
</head>

<body onLoad="document.readyState = 'complete'">
...
</body>

</head>

©2018 Martin Webb