js window.open

open() 方法用于打开一个新的浏览器窗口或查找一个已命名的窗口。

//新窗口打开页面 ‘a.htm’ 如果该窗口已经存在,则显示到前台。如果不存在则新打开一个。 
var opendwindow = window.open('', 'windowName',{});
opendwindow.focus();
if(opendwindow.location.href.indexOf('/a.html) == -1 ){
    opendwin.location.href = win_url;
}

猜你喜欢

转载自blog.csdn.net/blueblueuueew/article/details/70599719