简体   繁体   English

如何在新标签页中打开2个链接?

[英]How open 2 links in new tabs?

I use this code to open 2 sites in new tabs in browser 我使用此代码在浏览器的新标签页中打开2个网站

    $("#mylink").on('click', '#one', function () {
    window.open('registration.php', '_blank');
    window.open('readme.php', '_blank');

but when I click on link, second link has bet blocked as popup. 但是当我单击链接时,第二个链接被押为弹出窗口。 How to open 2 sites contemporaneously? 如何同时打开两个站点?

PS If this is not possible, how open second link in current browser tab? PS如果无法实现,如何在当前浏览器选项卡中打开第二个链接?

Unfortunately it's not possible to "unblock" it as a popup, as far as I know. 不幸的是,据我所知,不可能将其作为弹出窗口“解锁”。 It would be easier to just give 2 links. 只给出2个链接会更容易。

You can use _self as parameter to open in the same window. 您可以使用_self作为参数在同一窗口中打开。 ie

$("#mylink").on('click', '#one', function () {
    window.open('registration.php', '_blank');
    window.open('readme.php', '_self');
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM