index页面(分帧的主页):
<html>
<script>
function show(){
alert('index');
}
</script>
<frameset rows="20%,*">
<frame name="top" src="top.html">
<frameset cols="20%,*">
<frame name="left" src="left.html">
<frame name="right1" src="right1.html" id="one">
</html>
left页面:
<html>
<script>
parent.parent.show();
function show_left(){
alert('left');
}
</script>
<body>
left
</body>
</html>
首先我访问index主页,那么会执行left页面的parent.parent.show();这句话,就是调用主页的show()方法,这个是没错的。我想知道我在index.html文件中写什么js,可以调用到left页面的show_left()方法呢? 就是在父窗体怎么调用子窗体里的方法,因为我在父窗体中,获取不到子窗体对象。 希望各位大神帮忙解答一下,谢谢!JavaScriptHTML函数对象
<html>
<script>
function show(){
alert('index');
}
</script>
<frameset rows="20%,*">
<frame name="top" src="top.html">
<frameset cols="20%,*">
<frame name="left" src="left.html">
<frame name="right1" src="right1.html" id="one">
</html>
left页面:
<html>
<script>
parent.parent.show();
function show_left(){
alert('left');
}
</script>
<body>
left
</body>
</html>
首先我访问index主页,那么会执行left页面的parent.parent.show();这句话,就是调用主页的show()方法,这个是没错的。我想知道我在index.html文件中写什么js,可以调用到left页面的show_left()方法呢? 就是在父窗体怎么调用子窗体里的方法,因为我在父窗体中,获取不到子窗体对象。 希望各位大神帮忙解答一下,谢谢!JavaScriptHTML函数对象
<script>
function show(){
alert('index');
}
function callLeft(){
document.getElementById("left").contentWindow.show_left()
}
</script><frameset rows="20%,*">
<frame name="top" src="top.html">
<frameset cols="20%,*">
<frame name="left" src="2.html" id="left">
<frame name="right1" src="right1.html" id="one">
</html>