or you can name a page in frameset: <frameset rows="100,*"> <frame name="mywin" src="whatever.html"> <frame name="mywin2" src="whatever2.html"> </frameset>
try this: 1. copy these lines into a page, say "test.htm": <script language="javascript"> //window.name="one2two"; </script> <script> window.open("http://www.cnn.com","one2two"); </script>2. open it, and you will see two windows 3. remove "//" before window.name, try to open it again, you will see only one window
<frameset rows="100,*">
<frame name="mywin" src="whatever.html">
<frame name="mywin2" src="whatever2.html">
</frameset>
例:
<script language="javascript">
window.name="one2two";
</script>
<body>
......
</body>
<script>if (parent.name!=one2two){
window.open("test.htm")
}</script>
还是能打开的!
要不我再试试?
1. copy these lines into a page, say "test.htm":
<script language="javascript">
//window.name="one2two";
</script>
<script>
window.open("http://www.cnn.com","one2two");
</script>2. open it, and you will see two windows
3. remove "//" before window.name, try to open it again, you will see only one window