I have a script being run in a document that may or may not be nested in an iframe. I have sorted out the issue of detecting the nested, but I can\'t figure out how to detect t
You can place a SCRIPT tag at the end of the iframe BODY tag.
Then add your code there, it will be executed when the iframe body is loaded.
You can either run a local JS code of the iframe, or call an object in the parent like:
<body>
...
<script>
parent.myObj.iframeLoaded(document.body);
</script>
</body>
To my experience, the onload event in IE is not reliable.
i.e: it won't wait to the JS inside the iframe to be loaded before firing.