element.document.appendChild(oDateIframe);
改为
element.document.body.appendChild(oDateIframe);
试试

解决方案 »

  1.   

    taste the diffrences of the following:element.document.all.frmtest.style;
    window.frames["frmtest"].style;
    window.frames["frmtest"].document.body.style;
      

  2.   

    element.document.all.frmtest is a reference of IRFRAME object under WINDOW object, 
    and IRFRAME has style object,
    but window.frames["frmtest"] is a reference of WINDOW object, 
    and WINDOW has not style object, 
    however, window.frames["frmtest"].document.body has style object,so three above are object,undefined and object.
      

  3.   

    to: shyslysky(飞天) thanks再问一个问题在这个出现的iframe中如何再调用htc中的函数?window.frames["frmtest"].document.write("<h1>dad</h1><a onclick=Click()>aaa</a>");这样是不行的
      

  4.   

    you can not do like this, bucause the page of fratest is another one in which there is not Function Click() .you can do like the following:window.frames["frmtest"].document.write("<script language=javascript>function Click(){alert('hi!')}<"+"\/script> ");
    window.frames["frmtest"].document.write("<h1>dad</h1><a onclick=Click()>aaa</a>");Also, you can make Click() in fratest having the same function as Click() in a.htc.
      

  5.   

    但是如果不用htc的话用js那么frmtest中可以用 parent.Click() 这样来调用那么现在用了js改成htc后有没有类似的方法呢?难道一定要在frmtest中写script?
      

  6.   

    In my opinion, no other way!