开发者

hyperlink open is separate windows

I have used a js code to open a hyper link in a new window.

f开发者_开发百科unction 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')

}

And it's working fine.

But when I have changed the url and saved my code and refreshed the page, then called the function again, but it's not opening in a new window, it has refreshed the window opened before.

I want my new link to open in another new window, not in the same.

How can I do this?


The name you give to the opened window, open_window in your example, is associated with that windows, so that you can re-use it.

If you want a new window to open, give it a new name, or _blank to always open a new window.

I struggled finding a source to verify this, but it's explained on this page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜