window.open(url) not opening new web page in the same tab

后端 未结 5 846
情歌与酒
情歌与酒 2021-01-24 08:24

window.open(\"index.php\"); does not open the new page in the same tab, it opens it in a new tab.

I tried window.open(\"index.php\",

5条回答
  •  生来不讨喜
    2021-01-24 08:54

    window.open will open in new tab if action is synchronous and invoked by user. If you remove async: false from ajax options (and this method is invoked by user for example by clicking a button), then new window will open instead of new tab. For simple navigation set window.location.href

提交回复
热议问题