Why wont this resize of iframe height work?
I have a form on my main page (main.html) with the target set to an iframe on that page. The action of the frame on the main page is a php file. So, the php file displays in the iframe basically.
Now, I have this script in the php file to get height of content:
var x = document.body.scrollHeight;
window.parent.document.getelementbyid("iframe001").style.height=x;
If I alert x, the scrollheight is there, so x IS the scrollheight d开发者_运维技巧efinetely. That part works. But, I cant set that value to the height of the iframe (iframe001).
Any ideas why I cant do this? And how to do it?
Thanks
getelementbyid should be getElementById
also this answer might help you dynamic iframe height depending on PHP content?
精彩评论