The "InternetExplorercannotopentheInternetsite" error frequently occurs in ie6. The specific situation is as follows:
When the page is not fully loaded, a script event that generates iFrame is triggered by clicking the mouse.
First, we thought about adding a script event to the trigger position after the page is fully loaded. In this way, no script event exists here before the page is fully loaded, naturally, no error is reported.
The above method is somewhat passive, so see the script for generating iframe.
The normal page structure is
The Code is as follows:
The script for generating iframe is:
The Code is as follows:
Function CreateiFrame (){
Var objBody = document. getElementsByTagName ("body"). item (0 );
Var objiFrame = document. createElement ("iframe ");
ObjBody. appendChild (objiFrame );
}
AppendChild () method to add a new subnode at the end of the node's subnode list. Therefore, the DOM after the iframe is created is:
The Code is as follows:
Because it is in