简体   繁体   English

如何从Internet Explorer 9创建弹出窗口

[英]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.

相关问题 如何在Internet Explorer弹出窗口中打开小书签 - How to open bookmarklet in Internet explorer popup window 在 Internet Explorer 中打开的弹出窗口 - Popup window open in Internet explorer 将数据从调用者传递到 Inte.net Explorer 上的弹出窗口 window - Pass data from caller to popup window on Internet Explorer 如何在Internet Explorer中获取和设置窗口弹出的高度和宽度 - How to get and set window popup height and width in Internet Explorer 如何关闭Internet Explorer中的弹出窗口? - How to close a popup in Internet Explorer? VBA / Internet Explorer / Javascript:如何从同一Internet Explorer打开JavaScript窗口? - VBA / Internet Explorer / Javascript: How to open a javascript window from same internet explorer? 如何从Internet Explorer 11中的window.open返回值? - How to return value from window.open in Internet Explorer 11? Javascript打印弹出窗口适用于Firefox / Chrome但不适用于Internet Explorer - Javascript printing a popup window works in Firefox/Chrome but not Internet Explorer 如何从Internet Explorer中的JavaScript创建Java对象? - How to create a Java object from JavaScript in Internet Explorer? 如何在Internet Explorer中的新窗口中打开URL - How to open a url in a new window in Internet Explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM