[英]How To Create a Popup Window from Internet Explorer 9
I'm using the following to attempt to create a popup in IE 9 我正在使用以下内容尝试在IE 9中创建一个弹出窗口
function popUp(url) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(url,'" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=520,left = 400,top = 200');");
return false;
}
This works fine in Chrome, Firefox and Safari - but IE 9 refuses to open a popup - instead opening the url in a new tab. 这在Chrome,Firefox和Safari中运行良好 - 但IE 9拒绝打开弹出窗口 - 而是在新标签页中打开网址。 I've disabled the popup blocker in IE9 - but the function above still opens the url in a new tab and not in a popup. 我已经在IE9中禁用了弹出窗口阻止程序 - 但上面的函数仍然在新选项卡中打开了URL,而不是在弹出窗口中打开。
Any suggestions on how to get IE9 to 'popup'? 关于如何让IE9进入'弹出'的任何建议?
This code seems to work in IE9 (just checked - opens a new window, not a tab): 此代码似乎在IE9中工作(刚刚选中 - 打开一个新窗口,而不是选项卡):
function popUp(url) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(url,'" + id + "','_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=520,left = 400,top = 200');");
return false;
}
I think it may have something to do with indicating the window name, which is different from the existing window. 我认为它可能与指示窗口名称有关,这与现有窗口不同。
when the user has 'Let Internet Explorer decide how pop-ups should be open' which is the default, setting resize=yes will make IE9 open a tab and resize=no will allow the popup. 当用户“让Internet Explorer决定弹出窗口应该如何打开”这是默认设置时,设置resize = yes将使IE9打开一个选项卡并且resize = no将允许弹出窗口。 this might be the same with other attributes i haven't tested. 这可能与我未测试的其他属性相同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.