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

后端 未结 8 673
别那么骄傲
别那么骄傲 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:49

    I fixed this by adding

    onclick="myWin = window.open('','winName','location=0,width=300,height=214'); myWin.focus()"
    

    to the html element(button) and then change the URL via JS.

提交回复
热议问题