Javascript 超链接打开是单独的窗口
我使用js代码在新窗口中打开了一个超链接Javascript 超链接打开是单独的窗口,javascript,html,hyperlink,Javascript,Html,Hyperlink,我使用js代码在新窗口中打开了一个超链接 function openNewWindow() { alert("hello"); var theurl="http://www.google.com"; popupWin = window.open(theurl, 'open_window', 'menubar, toolbar, location, directori
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')
}
它工作得很好
但是,当我更改了url并保存了代码并刷新了页面,然后再次调用该函数时,它不会在新窗口中打开,而是刷新了以前打开的窗口
我希望我的新链接在另一个新窗口中打开,而不是在同一个窗口中
如何执行此操作?在您的示例中,您为打开的窗口指定的名称,
open\u window
与该窗口关联,以便您可以重复使用它
如果要打开一个新窗口,请给它一个新名称,或\u blank
始终打开一个新窗口
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')
}
我很难找到一个源代码来验证这一点,但它是。在您的示例中,您为打开的窗口指定的名称,
open\u window
与该窗口关联,因此您可以重复使用它
如果要打开一个新窗口,请给它一个新名称,或\u blank
始终打开一个新窗口
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')
}
我很难找到一个来源来证实这一点,但它是