主頁
=================================================================================
<body onload='document.getElementById("e").contentWindow.document.designMode="on";'>
<iframe ID="e" name="ei" src="a.html"></iframe> 
<script>
window.frames["ei"].src= 'a.html';
</script>
=================================================================================a.html
=================================================================================
<html>  
   
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=big5">  
  <style>  
  body  
  { 
line-height: 0px;
  font-size:14px;  
  color:red;  
  }  
  </stle>  
  </head>  
  </html>   
=================================================================================
在ie下正常工作但firefox下只show出
  body  
  { 
line-height: 0px;
  font-size:14px;  
  color:red;  
  }  
而且不能編輯iframe的內容

解决方案 »

  1.   

    星辰技术社区:www.netcsharp.cn,我们将帮您以最快的速度找到最佳的解决方案 
      

  2.   

    window.frames["e"].src= 'a.html';  用id获取 不要用name
      

  3.   

    是你把标签少写了一个字母吖。
    要仔细哦
    主页
    <body onload='document.getElementById("e").contentWindow.document.designMode="on";'>
    <iframe ID="e" name="ei" src="a.html"> </iframe>  
    <script>
    window.frames["ei"].src= 'a.html';
    </script>
    /*--------------------------------------------------*/
    a.html
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;   charset=big5">
        <style>   
      body  
      { 
    line-height: 0px;
      font-size:14px;  
      color:red;  
      }  
       </style>
    </head>
    </html>