Detect if IFRAME's document is malformed
问题 I'm loading a page into an IFRAME, and I would like to know if the download was incomplete .. and the HTML is malformed, and missing the closing tags like </body> and </html> . Is there any way to detect this in JavaScript? 回答1: I'm not sure if you can test for malformed HTML or missing elements without knowing exactly what to expect and testing for it specifically. If you have access to the source of the iframe page you could call a javascript function variable before the end of the </body>