JavaScript open in a new window, not tab

前端 未结 15 1667
余生分开走
余生分开走 2020-11-21 22:18

I have a select box that calls window.open(url) when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page t

15条回答
  •  生来不讨喜
    2020-11-21 23:01

    The key is the parameters :

    If you provide Parameters [ Height="" , Width="" ] , then it will open in new windows.

    If you DON'T provide Parameters , then it will open in new tab.

    Tested in Chrome and Firefox

提交回复
热议问题