2009-11-28 36 views
1

我已经使用js代码在新窗口中打开超链接。超链接打开是单独的窗口

function openNewWindow() { 
    alert("hello"); 
    var theurl="http://www.google.com"; 
    popupWin = window.open(theurl, 'open_window', 
          'menubar, toolbar, location, 
          directories, status, scrollbars, 
          resizable, dependent, width=640, 
          height=480, left=0, top=0') 

} 

它的工作正常。

但是,当我更改了网址并保存了我的代码并刷新了页面后,再次调用该函数,但它并未在新窗口中打开,它刷新了之前打开的窗口。

我想让我的新链接在另一个新窗口中打开,而不是相同。

我该怎么做?

回答

4

您给打开窗口的名字open_window与您的示例相关联,以便您可以重新使用它。

如果您想要打开一个新窗口,请指定一个新名称,或者拨打_blank以始终打开一个新窗口。

我努力找到一个来源来验证这一点,但它是explained on this page