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>

解决方案 »

  1.   

    错了a.htm应该是这样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>
      

  2.   

    错了应该是这样a.htm
    <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>
      

  3.   

    我觉得如果c是由a代开的应该只有a可以关闭它
    所以应在a中在加一个关闭按钮
    function close_win()
    {
      c_win.close()
    }
      

  4.   

    三个页面A,B,C,在A页面和B页面分别由一个按钮,A页面为OPEN,B页面为Close,点击Open按钮,打开C页面,点击Close按钮,关闭C页面A.htm
    <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方法打开命名窗口时,则被打开的窗口已存在则在该窗口打开