<iframe id="showOcx" name="showOcx" style="position:absolute;z-index:-1;width:100%;height:100%;top:0;left:0;scrolling:no;" frameborder="0" src="about:blank">
<script type="text/javascript">
function alertMsg(){
   alert(1);
}
</script>
<div class="vioxy">
   <object id="ocx1" width="619px" height="494px" classid="CLSID:FD3BEB0C-AB43-4253-9146" codebase='web.cab#version=1,0,0,0'><param name='Language' value='SimpChinese'></object>
</div>
</iframe>我在当前的这个父页中怎么调用 iframe中的方法啊?window.frames["showOcx"].alertMsg(); 这样没成功!

解决方案 »

  1.   

    你alert(showOcx.window.document.body.innerHTML)就知道为什么错了
      

  2.   

    晕。。楼主了解iframe怎么用的没,iframe加载的是页面,<iframe>这里的内容是浏览器不支持iframe时才显示的内容</iframe>
      

  3.   


    你写的“src="about:blank"”,所以输出为空~空的document哪来什么function能被调用~
      

  4.   

    嗯!懂了,要怎么才能在一个iframe上面显示一个隐藏层啊?
      

  5.   

    iframe的src属性里面写你隐藏层页面的url