父窗口给子窗口赋值
四个窗口,一个父窗口三个子窗口,父窗口控制3个子窗口3号为父窗口 1、2、4为子窗口
3号窗口
<HTML><head><meta http-equiv="Content-Type" content="text/html; charset= gbk" /><title>窗口测试</title><script type="text/javascript">window.self.focus(); moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight);var main1;var main2;var main3;function openScreen(){main1 =window.open("main1.html","main1","height=600, width=700, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no");main2 = window.open("main2.html","mian2","height=600, width=700, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no");main4 = window.open("main4.html","main4","height=600, width=700, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no");}function setScreen1(){main1.document.getElementById("span1").innerHTML += "中国有黄河";}function setScreen2(){main2.document.getElementById("span2").innerHTML += "中国有长江";}function setScreen3(){main4.document.getElementById("span4").innerHTML += "中国还是汉江";}</script><body bgcolor="#EEF6FF" >3号<br><a > 将"中国有黄河"赋值给1号屏幕</a><br><a > 将"中国有长江"赋值给1号屏幕</a><br><a > 将"中国还是汉江"赋值给1号屏幕</a><br></body></html>
1号窗口
<HTML><head><meta http-equiv="Content-Type" content="text/html; charset= gbk" /><title>窗口测试</title><script type="text/javascript">window.self.focus(); moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight);</script><body bgcolor="#EEF6FF">1号<br><span id="span1" >我获得3号屏幕的信息是:</span></body></html>
2号窗口
<HTML><head><meta http-equiv="Content-Type" content="text/html; charset= gbk" /><title>窗口测试</title><script type="text/javascript">window.self.focus(); moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight);</script><body bgcolor="#EEF6FF" >2号<br><span id="span2" >我获得3号屏幕的信息是:</span></body></html>
4号窗口
<HTML><head><meta http-equiv="Content-Type" content="text/html; charset= gbk" /><title>窗口测试</title><script type="text/javascript">window.self.focus(); moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight);</script><body bgcolor="#EEF6FF">4号<br><span id="span4" >我获得3号屏幕的信息是:</span></body></html>
页:
[1]