写错了,是:
window.frames["t"].onload = function(){
alert( "ok!" );
}

解决方案 »

  1.   

    <iframe name="t" id="t" src="http://www.163.com"></iframe>
    <script language="javascript">
    <!--
    document.getElementById("t").onreadystatechange = function(){
    if( this.readyState == "complete" )
    alert( "ok!" );
    }
    //-->
    </script>
      

  2.   

    就是说,为iframe对象绑一个状态改变的event listener,当状态为“complete”时,触发你要执行的function
      

  3.   

    下面这个方法不行的原因是什么?
    ========================
    window.frames["t"].onload = function(){
    alert( "ok!" );
    }
      

  4.   

    you can do as this :
    <iframe name="t" src="test.htm" onload="yourFunc()"></iframe>obj.frames["frameID"]:Retrieves a window objects defined by the given ID.This window object only and DOES NOT provide access to the corresponding FRAME and IFRAME elements. To access these elements, use the 'all ' collection for the document containing the elements. 
      

  5.   

    我试过,onload系firefox浏览器下有效,在IE下没有反应, 
    而onreadystatechange刚好相反
      

  6.   

    hansonboy(良)的方法我没试过,我觉得可能是这个原因吧。但为什么有这个差别呢?
      

  7.   

    ice_berg16(寻梦的稻草人) 
    这个方法不错~~~