Recently, the js method for dynamically creating iframe was used in the project. It was found that iframe. frameborder & quot; 0 & quot; does not work in IE7, while chromeff is normal and depressing.
The Code is as follows:
Var iframe = document. createElement ("iframe ");
Iframe. id = "frame-" + index;
Iframe. src = url;
Iframe. width = "100% ";
Iframe. marginwidth = "0 ";
Iframe. scrolling = "no ";
Iframe. frameborder = "0 ";
Use "view source code of the selected Region" in IE to find that the created iframe code is I searched the information online. It turns out that IE does not recognize lowercase letters. I am dizzy .... <br> use <BR> <p class = "codetitle"> <U> </U> the code is as follows: </p> <p class = "codebody" id = "code87544"> <BR> setAttribute ("frameborder", "0", 0 ); <BR> // The problem is fixed. <BR> </p> <br> <p class = "codetitle"> <U> </U> the code is as follows: </p> <p class = "codebody" id = "code65518"> <BR> var iframe = document. createElement ("iframe"); <BR> iframe. id = "frame-" + index; <BR> iframe. src = url; <BR> iframe. width = "100%"; <BR> iframe. marginwidth = "0"; <BR> iframe. scrolling = "no"; <BR> iframe. setAttribute ("frameborder", "0", 0); // The Last 0 indicates whether the case is different. The problem is solved.