Internet Explorer is out of Internet Explorer 8, and fewer people are using Internet Explorer 6, but they still exist. For example, qamm is in use.
Therefore, the problems in IE6 must also be solved. In the past two days, I met one:
Html
< Table >
< Tr >
< TD ID = "Tdtest" Runat = "Server" >
< IFRAME ID = "Ifrtest" Height = "100%" Runat = "Server" > </ IFRAME >
</ TD >
</ Tr >
</ Table >
Code
Protected Void Page_load ( Object Sender, eventargs E)
{
This . Ifrtest. Attributes. Add ( " SRC " , " Ie6.aspx " );
}
Very simpleCodeIt is very simple to nest an IFRAME and bind IFRAME to the background to display the page content. However, such a simple code will not be displayed in IE6 !!
Why? This is where the problem occurs.Height= "100%"In IE6, I do not know whether to get the height or get the TD's original 0 before the SRC value. It will not be displayed anyway.
Knowing the problem is simple... There are n solutions:
1. RemoveHeight= "100%"However, it is not satisfactory to set the IFRAME height.
2. Set a fixed value for TD or IFRAME in the background:
Code2
This. Tdtest. Height= "200px";
3. The front-end dynamically sets the IFRAME height:
Code3
This. Ifrtest. Attributes. Add ("Onload","Iframeautoheight (this)");
The front-end must add: (the following section of JS comes from the Network)
Script
Function Iframeautoheight (OBJ)
{
VaR ID = OBJ. ID;
VaR Subweb = Document. Frames ? Document.frames[id).doc ument: obj. contentdocument;
If (OBJ ! = Null && Subweb ! = Null )
{
OBJ. Height = Subweb. Body. scrollheight;
}
}
4. Think about it ....
In addition, it is said on the Internet that the SCR attribute in IE6 cannot be displayed at the top, but I cannot try it out. If anyone knows, please advise: kenblove # gmail.com