框架名.方法名.如调用父框架中的  f1();
parent.f1()l;

解决方案 »

  1.   

    写在a.html中
    <input type="button" value="button" name="abuttonname" 
    onclick="top.frames[1].document.all.bbuttonname.click()">
      

  2.   

    a.htm:
    <body>
    <input type="button" id="btnA" onclick="alert('Hello,A!');" value="Hello,A!">
    <input type="button" onclick="parent.document.frames[1].document.all.btnB.click();" value="调用B">
    </body>b.htm:
    <body>
    <input type="button" id="btnB" onclick="alert('Hello,B!');" value="Hello,B!">
    <input type="button" onclick="parent.document.frames[0].document.all.btnA.click();" value="调用A">
    </body>
    框架页:
    <frameset cols="50%,*">
      <frame name="left" src="a.htm">
      <frame name="right" src="b.htm">
      <noframes>
      <body>
      <p>此网页使用了框架,但您的浏览器不支持框架。</p>
      </body>
      </noframes>
    </frameset>
      

  3.   

    出自一位老大。(1)如果是在同一个窗口内,(即使用框架)页面间的函数可以互相调用。
    调用格式为
       frame_name.function_name();(2)如果这些页面在不同的窗口。但是有创建和被创建的关系。页面间的函数可以互相调用。
    调用方法
    创建者--〉被创建者 ch=windows.open("xxx");ch.function_name();
    被创建者--〉创建者  window.opener.function_name()(3)页面没有关系,那么只能通过服务器端中转了。
    记住,web编程是无状态编程。提交后,就不是原来的页面了。
    至于怎么调用,根据需要来定,提交后要自动调用时一般用onload事件。
    只需记住客户端代码在服务器端只是一个字符串流就可以了。
      

  4.   

    我想用 a.html 中的button  onclick 调用 b.html 的onclick 事件..
    a.html 中的button 按下之后,, 出现的时  hello B.html...可以做到么?可以:在a.html中:
    <input type="button" id="btnA" onclick="javascript:left.B_alert()" >
    在b.html中:
    <script language="javascript">
    function B_alert()
    {
     alert("hello B.html");
    }
    </script>
    <input type="button" id="btnB" onclick="javascript:B_alert()" >