<div class="codetitle"> <span><a style="CURSOR: pointer" data="95830" class="copybut" id="copybut95830" onclick="doCopy('code95830')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code95830"> <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.frameborder="0"; <br> </div> <br>使用IE中“查看选定区域源代码”发现创建的iframe代码是<IFRAME frameborder=0/>,网上搜了下资料,原来是IE不认小写,我晕死.... <br><br>使用 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="87544" class="copybut" id="copybut87544" onclick="doCopy('code87544')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code87544"> <br>setAttribute("frameborder", "0", 0); <br>//问题解决了。 <br> </div> <br><br><div class="codetitle"> <span><a style="CURSOR: pointer" data="65518" class="copybut" id="copybut65518" onclick="doCopy('code65518')"><u>复制代码</u></a></span> 代码如下:</div> <div 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); //最后一个0表示是否区别大小写,问题解决 <br> </div>