简体   繁体   中英

Javascript - Pop-up new parent window

I have this code

function checkAlerts() {
    secondsSinceLoad += 1;
    for(var mj = 0 ; mj <= alertList.length; mj++) {
                    if(alertList[mj]['time'] < secondsSinceLoad && alertList[mj]['time'] > -1 ) {
                            alertmsg = alertList[mj]['type'] + ":" + alertList[mj]['name'] + "\n" +alertList[mj]['subtitle']+ "\n"+ alertList[mj]['description'] + "\n\n";
                            window.open(alertList[mj]['redirect'],"name1","width=800,height=500,toolbar=no,location=no,menubar=no,copyhistory=no");
                    }
    }
    alertsTimeoutId = setTimeout("checkAlerts()",1000);

}

This is a scheduled popup. It creates a pop-up correctly, however if there are more than 1 scheduled pop-up at same time then only 1 pop-up is shown.

PS I'm presuming it's because the "parent popup has same window opened"

Help is appreciated.

Thanx.

Browsers ban the opening of multiple popups in a loop to stop malicious sites bombing users with lots of new windows.

Work around it by avoiding popups and displaying all your content in a single window.

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