Javascript Bring window to front if already open in window.open?

后端 未结 8 688
别那么骄傲
别那么骄傲 2020-11-30 07:35

If you open a window like:

window.open (\"url\",\"winName\",\"location=0,width=300,height=214\");

If winName is already open i

8条回答
  •  没有蜡笔的小新
    2020-11-30 07:45

    Closing the window first, does the trick for me:

    window.open('', 'mypopup').close();
    setTimeout(function() {
        window.open('', 'mypopup').focus();
    }, 500);
    

提交回复
热议问题