Override window.open()

后端 未结 1 687
清酒与你
清酒与你 2020-12-20 02:17

I\'m trying to override window.open(), so I\'m trying to find a way to open link in new window without window.open().

In detail, I\'m in su

1条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-20 02:47

    From javascript alone you can't open a new window without using window.open(). Also you have no influence on how the window is opened in new browsers. It depends on the browser-settings whether this opens a new tab or a new window.

    You can declare that you want a new window by defining target="_blank"href="..."> on a a-element, but then the user has to click it. Otherwise if you trigger a click with javascript you will run into the popup blockers of the browsers.

    0 讨论(0)
提交回复
热议问题