a.htm
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script>var c_win
function open_win()
{
c_win=new window.open("c.htm","","height=200,width=300")}
</script></head><body><form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" WEBBOT-onSubmit>
<p><input type="button" value="open" name="B3" onClick="open_win()"></p>
</form></body></html>
*******************************
b.htm
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
<script>
function close_win()
{
if(!c_win){alert("窗口C没有打开")}
else if(c_win.closed){alert("窗口C已经关闭")}
else{c_win.close()}
}</script>
</head><body><form method="POST" action="--WEBBOT-SELF--">
<p><input type="button" value="关闭" name="B3" onClick="close_win()"></p>
</form></body></html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script>var c_win
function open_win()
{
c_win=new window.open("c.htm","","height=200,width=300")}
</script></head><body><form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" WEBBOT-onSubmit>
<p><input type="button" value="open" name="B3" onClick="open_win()"></p>
</form></body></html>
*******************************
b.htm
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
<script>
function close_win()
{
if(!c_win){alert("窗口C没有打开")}
else if(c_win.closed){alert("窗口C已经关闭")}
else{c_win.close()}
}</script>
</head><body><form method="POST" action="--WEBBOT-SELF--">
<p><input type="button" value="关闭" name="B3" onClick="close_win()"></p>
</form></body></html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script>var c_win
function open_win()
{
c_win=new window.open("c.htm","","height=200,width=300")}
</script></head><body><form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" WEBBOT-onSubmit>
<p><input type="button" value="open" name="B3" onClick="open_win()"></p>
</form></body></html>
<html><head><title>a</title>
<script>var c_win
function open_win()
{
c_win=window.open("c.htm","","height=200,width=300")}
</script></head><body><form method="POST" action="_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" WEBBOT-onSubmit>
<p><input type="button" value="open" name="B3" onClick="open_win()"></p>
</form></body></html>
所以应在a中在加一个关闭按钮
function close_win()
{
c_win.close()
}
<input type=button onClick="open('C.htm','WinC')" value=OPEN>B.htm
<input type=button onClick="win=open('','WinC');win.close()" value=CLOSE>C.htm
任意内容要点:open方法打开命名窗口时,则被打开的窗口已存在则在该窗口打开