简体   繁体   中英

How open 2 links in new tabs?

I use this code to open 2 sites in new tabs in browser

    $("#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?

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.

You can use _self as parameter to open in the same window. ie

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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