在b.html中  <input type="button" value="test" onClick="parent.abc()"/>

解决方案 »

  1.   

    在使用ifrmae后要引用父页面的对象,方法,使用parent.object就可以了
      

  2.   

    为什么不行?在IE下可以,但是在firefox下就不行!
      

  3.   

    在FF下alert();不能为空。
    要有参数;
    最少也 alert('');
      

  4.   

    a.html
    <html>
    <script>
    function abc(){
      alert("OK");
    }
    </script>
    <iframe src="b.html"></iframe>
    </html>b.html
    <button onclick="parent.abc()">Test</button>
      

  5.   

    奇怪,为什么我的firefox用上面的代码没反应?没有弹出窗口啊,IE是没问题的?firefox有哪些需要配置吗?我的版本是3.01的。
      

  6.   


    这样是可以的.在IE 中alert(); 可以有参数或者没参数;  FF 中一定要有参数.
    我在FF3.0的版本试了.可以.你下个firebug看看