I need to access document object of document inside an IFRAME. Is there a way to do that for IE7 and IE8?
I need to get the scrollHeight
property of the document inside the <iframe>
. I tried all the opti开发者_C百科ons which are:
contentWindow.document
contentDocument
window.frames
All these works fine for IE9,chrome and FF. But i couldnot get it to work in IE7 and IE8.
If anyone has a solution that would be great.
thanks
try out :
contentWindow.documentElement.document
Try this
<script>
var iframe_doc = "window.document.getElementById('your_iframe_id').document";
iframe_doc = eval(iframe_doc);
</script>
The above code should return you the iframe document, then get the scrollHeight attribute of the iframe document.
精彩评论