window.open("test.htm", "B");
这个B就是窗口名称,你如果是第一次打开就会弹出新窗口,以后就会再这个窗口里打开test.htm页面了

解决方案 »

  1.   

    var win=window.open("test.htm", "B");
    可以通过win.closed来判断新开的窗口是否处于打开状态
      

  2.   

    《JavaScript权威指南》 P243 “打开窗口”
      

  3.   

    对第二个参数的描述:
    windowName  A string specifying the window name to use in the TARGET attribute of a FORM or A tag. windowName can contain only alphanumeric or underscore (_) characters. 描述
    In event handlers, you must specify window.open() instead of simply using open(). Due to the scoping of static objects in JavaScript, a call to open() without specifying an object name is equivalent to document.open(). 
    The open method opens a new Web browser window on the client, similar to choosing New Navigator Window from the File menu of the browser. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created. You can use open on an existing window, and if you pass the empty string for the URL, you will get a reference to the existing window, but not load anything into it. You can, for example, then look for properties in the window. windowFeatures is an optional string containing a comma-separated list of options for the new window (do not include any spaces in this list). After a window is open, you cannot use JavaScript to change the windowFeatures. The features you can specify are: 
      

  4.   

    好象这样不行啊。没办法实现了。
    index.htm
    <html>
    <head>
    <title>首页</title>
    <Script>
    var OpenWindow;
    function OpenFile(FileUrl)
    {
       if (OpenWindow !=null)
       OpenWindow.close;
       OpenWindow=window.open('','Gis','fullscreen=0,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
    OpenWindow.focus();
    OpenWindow.location=FileUrl;
    }
    </Script>
    <body>
    <a href="javascript:/**/" onClick="OpenFile('Map.htm');">Map</a><br>
    <a href="javascript:/**/" onClick="OpenFile('Gis.htm');">Gis</a><br>
    </body>
    </head>
    </html>
    --------------------------------------------------------------------
    Map.htm
    <html>
    <head>
    <title>Map</title>
    <Script>
    var OpenWindow;
    function OpenFile(FileUrl)
    {
       if (OpenWindow !=null)
       OpenWindow.close;
       OpenWindow=window.open(FileUrl,'Gis','fullscreen=0,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
    OpenWindow.focus();
    }
    </Script>
    </head>
    <body scroll="no">
    <a href="javascript:/**/" onClick="OpenFile('Gis.htm');">Gis</a>
    </body>
    </html>
    ----------------------------------------------------------------
    <html>
    <head>
    <title>Gis</title>
    <Script>
    var OpenWindow;
    function OpenFile(FileUrl)
    {
       if (OpenWindow !=null)
       OpenWindow.close;
       OpenWindow=window.open(FileUrl,'Map','fullscreen=0,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
    OpenWindow.focus();
    }
    </Script>
    </head>
    <body scroll="no">
    <a href="javascript:/**/" onClick="OpenFile('Map.htm');">Map</a>
    </body>
    </html>
    -----------------------------------------------------------------
    我操作如下,index.htm->Map.htm Or Gis.htm,然后在Map.htm Or Gis.htm,互点连接是可以的。
    但是,存在以下的问题:index.htm-Map.htm Or Gis.htm,但是若此前Gis.htm或Map.htm已经存在,那么互点就存在问题了。非常感谢楼上几位朋友的热心回答,但是还没有解决问题了。