本帖最后由 lxx200830740218 于 2013-01-10 16:49:59 编辑

解决方案 »

  1.   

    跨域无解,操作不了跨域的iframe如果不是跨不同的顶级域,可以设置document.domain来实现跨不同2级域名的操作
      

  2.   

    function iFrameHeight() { 
    var ifm= document.getElementById("iframe1"); 
    var subWeb = document.frames ? document.frames["iframe1"].document : ifm.contentDocument; 
    if(ifm != null && subWeb != null) { 
    ifm.height = subWeb.body.scrollHeight; 
    }
    }