如何跨frame调用方法? 框架名.方法名.如调用父框架中的 f1();parent.f1()l; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写在a.html中<input type="button" value="button" name="abuttonname" onclick="top.frames[1].document.all.bbuttonname.click()"> 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> 出自一位老大。(1)如果是在同一个窗口内,(即使用框架)页面间的函数可以互相调用。调用格式为 frame_name.function_name();(2)如果这些页面在不同的窗口。但是有创建和被创建的关系。页面间的函数可以互相调用。调用方法创建者--〉被创建者 ch=windows.open("xxx");ch.function_name();被创建者--〉创建者 window.opener.function_name()(3)页面没有关系,那么只能通过服务器端中转了。记住,web编程是无状态编程。提交后,就不是原来的页面了。至于怎么调用,根据需要来定,提交后要自动调用时一般用onload事件。只需记住客户端代码在服务器端只是一个字符串流就可以了。 我想用 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()" > Js写的游戏哦,有雷电,超级玛丽等 firefox中childNode 的问题 请教各种大师,关于上下移动的问题 好,好,好心人帮帮忙啊 javascrit的内存释放的问题 手机网站 100分求解!如何让下面的js代码只显示相匹配的关键词?最好每个关键词只显一个? 一个计算税率的小程序,不知道问题在哪? js在客户端 的文件操作问题 fso 当鼠标在某网页上移动时,网页自动返回到该网页的上一页,我写的代码如下,但有问题,请指出?:)急 谢了 动态改变显示内容? substring函数怎么用
<input type="button" value="button" name="abuttonname"
onclick="top.frames[1].document.all.bbuttonname.click()">
<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>
调用格式为
frame_name.function_name();(2)如果这些页面在不同的窗口。但是有创建和被创建的关系。页面间的函数可以互相调用。
调用方法
创建者--〉被创建者 ch=windows.open("xxx");ch.function_name();
被创建者--〉创建者 window.opener.function_name()(3)页面没有关系,那么只能通过服务器端中转了。
记住,web编程是无状态编程。提交后,就不是原来的页面了。
至于怎么调用,根据需要来定,提交后要自动调用时一般用onload事件。
只需记住客户端代码在服务器端只是一个字符串流就可以了。
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()" >