因为你在执行<script>
alert(document.all.myframe.contentWindow.document.all.img1.height)
</script>的时候,myframe对象,img1对象还没有生成
alert(document.all.myframe.contentWindow.document.all.img1.height)
</script>的时候,myframe对象,img1对象还没有生成
document.frames["myframe"].contentWindow.document.all.img1.height
而且要在onload以后