Today, in order to make an IFRAME that can automatically adapt to the height,
< IFRAME SRC = "Balance. aspx" Onload = "Javascript: resize_iframe ();" Scrolling = "No" Name = "Userinfo" Height = "0" Width = "0" Frameborder = "0" >
</ IFRAME >
Use the following JS control:
Alert(userinfo.doc ument. Body. scrollheight );
Alert(userinfo.doc ument. Body. scrollwidth );
Document. All ( " Userinfo " ). Height = Userinfo.doc ument. Body. scrollheight;
Document. All ( " Userinfo " ). Width = Userinfo.doc ument. Body. scrollwidth;
The height and width of the IFRAME remain the same, and 0 will drive people crazy ..
Later, I occasionally changed width = "0"Width = "1"A miracle! JavaScript scripts are controllable !!
The subsequent test showed that the height obtained by userinfo.doc ument. Body. scrollheight is always 0 as long as the width = "0. However, it is strange that putting Height = "0" has no effect!
I don't know if this is a bug of IFRAME.