< iframe> shows the content of the file it loads. Then how to get the content it shows?
Here is an example for it:
<iframe id=”upload_target” name=”upload_target”></iframe>
javascript code is as below:
var xx = document.getElementById(‘MyIFrame’).contentDocument.body.innerHTML;
alert(xx);
I have tested it on IE8、firefox 3.6.12、Google Chrome 7.0.517.44, it all works.
If the above doesn’t work, try these two as below:
document.getElementById(‘target_upload’).contentWindow.document.documentElement.innerHTML
or
document.getElementById(‘target_upload’).contentWindow.document.body.innerHTML