tags:

views:

91

answers:

2

i'm trying to open popup window this this jscript: window.open(myUrl, ""); for some users the page appears in a new tab, but I want it in a popup window. maybe someone know any reason for it?

+2  A: 

For the most part, this is a configuration setting in most modern browsers that the user controls. However, if you specify window dimensions and/or features on the window.open call, some browsers may open a new window when they otherwise would have opened a new tab. For example:

window.open("mypage", "_blank", "width=400,height=200,menubar=no,toolbar=no");

At the end of the day, though, it's stil down to the browser implementation, and as ever, you'll need to test to ensure you're getting the results you hope for across the majority of browsers your app/site supports/typically sees.

T.J. Crowder
Do you have an idea how to avoid ne wwindow to apear in new tab (only through jscript and not with configuration changes)?
question
@question: If you've done the above and it's still going to a new tab, I don't think there's anything further you can do. The above works with Chrome 4 and Firefox 3.6. I don't know of a way to get IE to do it if the user has it set to open windows in tabs.
T.J. Crowder
+1  A: 

This article might be of help: http://www.blazonry.com/javascript/windows.php. You need to specify size attributes.

window.open(myUrl, "_blank", "width=640,height=480,menubar=no,toolbar=no");
Propeng
not help! also after specifing the size
question
@question Your browser is probably set to show all new popups in tabs.
Propeng