window.open("test.htm", "B");
这个B就是窗口名称,你如果是第一次打开就会弹出新窗口,以后就会再这个窗口里打开test.htm页面了
这个B就是窗口名称,你如果是第一次打开就会弹出新窗口,以后就会再这个窗口里打开test.htm页面了
解决方案 »
- JS求合中遇到的问题
- 网页刷新问题
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 jQuery、html大牛麻烦进来帮帮忙,关于ol、li的问题
- 请问IE7下javascript函数的执行问题
- 点击确定,实现页面跳转的问题?急!
- 如何改变浏览器的大小,并且,把工具栏等去掉
- 关于《IE6.0打印机制解析》的问题,高手请进!200分
- 紧急!100分。答对就给。不够再加!对于高手问题很简单。对于菜鸟的我……
- 我自已做了一个倒计时的htm,改成asp出现问题,who can halp me!!
- js如何实现跨域只抓取文本(只是文本不包含HTML)
- 奇怪的问题,点击相应链接为什么不弹出对应的链接地址?
- 如何做到:点击某个flash,alert出相应的flash地址,用正则或DOM都可以
可以通过win.closed来判断新开的窗口是否处于打开状态
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:
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已经存在,那么互点就存在问题了。非常感谢楼上几位朋友的热心回答,但是还没有解决问题了。