How to create a popup from Internet Explorer 9

I use the following to try to create a popup in 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 window - instead, it opens the URL in a new tab. I disabled the popup blocker in IE9, but the function above still opens the URL in a new tab, not pops up.

Any suggestions on how to get IE9 to pop up?

+4
source share
2 answers

This code seems to work in IE9 (just checked - opens a new window, not a tab):

 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 this may have something to do with specifying a window name that is different from an existing window.

+3
source

when the user "Allows Internet Explorer to decide how pop-ups should be opened", that by default, the resize = yes parameter will cause IE9 to open the tab and resize = no, this will allow the pop-up. it may be the same with other attributes that I have not tested.

+3
source

All Articles