简体   繁体   English

Javascript-弹出新的父窗口

[英]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. 它正确创建了一个弹出窗口,但是,如果同时有多个计划的弹出窗口则仅显示1个弹出窗口。

PS I'm presuming it's because the "parent popup has same window opened" PS我想是因为“父弹出窗口打开了相同的窗口”

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. 通过避免弹出窗口并在单个窗口中显示所有内容来解决此问题。

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

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