在frame的页面内,我要frame1的jsp文件控制另一frame2中的html文件中的JavaScript方法执行

来源:百度知道 编辑:UC知道 时间:2024/09/21 03:37:56
具体说明:frame2中的html文件有js方法,用于控制“控制菜单”的收缩(包括图片,方法,总之不可能在其他页面调用该js方法就完事),我想在frame1的jsp文件中,控制frame2中的js方法何时执行,请问可有什么思路?
谢谢!

以下为举例,聪明的你一看就懂!
<frameset rows=20%,*>
<frame src=a.htm name=a>
</frame>
<frame src=b.htm name=b></frame>
</frameset>

a.htm
<button onclick=parent.b.b2.value="123456">test</button>
b.htm
<button id=b2>value</button>

frame2.myfuncton

frame2是你<frameset 里面的 name="frame2"

这样声明的就行了。