假设abc()这个是iframe中的函数,同时这个函数操作的是iframe页面中的内容
art()是当前父页面的函数,那么应该怎样在art()中运行iframe中的这个abc(),//iframe页 load.html
functon abc(){
 .............
}//当前页面
<iframe src=/load.html
function art(){
  该怎样执行abc()使之操作load.html页面中的内容
}

解决方案 »

  1.   

    父页面脚本
    <script>
    function callChildFrame() {
    load.abc();
    }
    </script>
    <input type="button" value="callChild" onclick="callChildFrame()" />
    <hr />
    <div>
    <iframe name="load" src="load.htm" />
    </div>
    iframe子页面load.htm脚本
    <script>
    window.abc = function abc() {
    alert('this is the function abc in iframe load');
    }
    </script>
    this is load.htm
      

  2.   

    js定义的都可以认为是window的属性,只要得到abc()所在的windowdoucment.frames["framename"].abc();
      

  3.   

    2楼
    document都写错了还能加10分!