Does anyone know how to get the HTML out of an IFRAME? I have tried several different ways:
document.getElementById('iframe01').contentDocument.body.innerHTML
, document.frames['iframe01'].document.body.innerHTML
, document.getElementById('iframe01').contentWindow.document.body.innerHTML
, etc
but none of them worked.
I believe the reason they're not working is that the content of my iframe doesn't have a body tag (I'm loading XML). Any other way to get all the contents of the iframe? I am open to jQuery too.
This:
document.getElementById('iframe01').contentWindow.document.body.innerHTML
works fine in the IE, but this:
document.getElementById('iframe01').contentDocument.body.innerHTML
does not work for FF.