谁能给我个合理的解释,关于IE下动态生成iframe的问题
代码如下: 
  <!doctype   html   public    "-//w3c//dtd   html   4.0   transitional//en ">  
  <html>  
  <head>  
  <title>    new   document    </title>  
  <meta   name= "generator "   content= "editplus ">  
  <script   language= "JavaScript ">  
  <!-- 
 window.onload   =   function(){ 
 var   iframe   =   document.createElement( 'iframe '); 
 iframe.id   =    'test '; 
 iframe.name   =    'test '; 
 document.body.appendChild(iframe); 
 } 
 //-->  
  </script>  
  </head>    
  <body>  
  <form   action= "test.asp "   target= "test "   onsubmit= "alert(document.getElementsByTagName( 'iframe ').length); ">  
  <input   type= "submit "   value= "do "/>  
  </form>  
  </body>  
  </html>  
 -------------------- 
 代码是这样的,动态生成个iframe然后让form表单数据提交到这个iframe里   
 在IE里,我点击按钮的时候,总是在新窗口中打开那个test.asp,而不会在那个动态生成的iframe里,在FF下却没有这个问题,为什么,谁能给我个合理的解释
------解决方案--------------------试试用 插入 HTML 代码的方式吧.   
 这个应该是IE的BUG 
 你用  document.body.innerHTML += ' <iFrame id= "test " name= "test " src= " ">  </iFrame>  '; 
  准保就好了.   
------解决方案--------------------对于ie,iframe标签的name是readonly的,不过iframe里的window对象的name是可以改变的: 
 以下代码演示ie的情况:     
  <!doctype html public  "-//w3c//dtd html 4.0 transitional//en ">  
  <html>  
  <head>  
  <title>  new document  </title>  
  <meta name= "generator " content= "Microsoft FrontPage 4.0 ">  
  <script language= "JavaScript ">  
  <!-- 
 window.onload = function(){ 
 var iframe = document.createElement( 'iframe '); 
 iframe.name= "aaa "; 
 alert(iframe.outerHTML); 
 document.body.appendChild(iframe); 
 document.frames[0].name= "test "; 
 } 
 //-->  
  </script>  
  </head>    
  <body>  
  <form action= "test.asp " target= "test " onsubmit= "alert(document.getElementsByName( 'test ').length); ">  
  <input type= "submit " value= "do "/>  
  </form>  
  </body>  
  </html>    
------解决方案--------------------很多标签的name属性都是readonly的,ie的帮助文件里通常会作特别说明,如果想赋标签的name,就用innerHTML来做。 
 另外,ie也可以通过如下来create带名字的标签: 
 var iframe = document.createElement( ' <iframe name= "test ">  ');
------解决方案--------------------iframe.name= "test ";//赋值不成功 
 document.frames[0].name= "test ";//赋值成功   
 原因并不是“对于ie,iframe标签的name是readonly的” 
 因为IE中是这样说明的:   
 name 
 --------------------------------------------   
 Description 
 Specifies the name of a window or the frame so it can be targeted from links in other documents.    
 Syntax 
 object.name[ = sName] //以这种语法表示的是可读写的属性。   
 Settings 
 This read/write property takes either a window name or frame name, or one of these special values。。。   
 Remarks 
 An exception to the rule, the window keyword must be used to access the name property.