User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » JavaScript window.open not working in IE9 Page [1]  
FroshKiller
All American
51911 Posts
user info
edit post

I'm supporting an application that uses the JavaScript method window.open to open a link in a new browser window. I need a sanity check.

It's Internet Explorer 9 on 32-bit Windows 7. All add-ons are disabled, the pop-up blocker is turned off, and the site is in the Trusted Sites zone.

The sanity check: The call to window.open seems to only work a handful of times if the window being opened is named optionWin. You boot up the machine, you open Internet Explorer, you log in the application, you click the link, and it works maybe 1-5 times. After that, the pop-up window will not get created when the link is clicked until after you reboot the computer.

I've used the IE developer tools to debug the JavaScript, and the debugger hits the call to window.open every single time. It's just that nothing happens. The window is not created, and no error is logged to the console.

What the hell?

[Edited on April 3, 2013 at 3:36 PM. Reason : r not d]

4/3/2013 3:18:34 PM

Lionheart
I'm Eggscellent
12775 Posts
user info
edit post

Maybe something dumb like Popup Blocker or Javascript security settings?

4/3/2013 3:26:08 PM

FroshKiller
All American
51911 Posts
user info
edit post

Dude.

4/3/2013 3:36:12 PM

Lionheart
I'm Eggscellent
12775 Posts
user info
edit post

wasn't trying to be a jerk, Occam's Razor man

[Edited on April 3, 2013 at 3:39 PM. Reason : didn't read closely enough]

4/3/2013 3:39:26 PM

Stimwalt
All American
15292 Posts
user info
edit post

Try dropping the Custom Level to the lowest security setting possible and see if that makes any difference.

It doesn't make sense that it would be rights if it works intermittently.

Also try logging into machine as Administrator.

[Edited on April 3, 2013 at 4:01 PM. Reason : -]

4/3/2013 4:00:17 PM

Noen
All American
31346 Posts
user info
edit post

In IE, you can't have spaces in your second variable (the new window's name).

Try:

window.open (address,'Ver_articulo', config=center);

4/3/2013 4:28:11 PM

FroshKiller
All American
51911 Posts
user info
edit post

You see the part where the parameter being passed is optionWin?

Stimwalt: The Trusted Sites zone security is set to the Low level, and no other pop-ups are affected--just ones where the target window name is optionWin.

[Edited on April 3, 2013 at 4:49 PM. Reason : ...]

4/3/2013 4:48:12 PM

BigMan157
no u
103354 Posts
user info
edit post

http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/cc2bf09b-c811-430b-b0a0-b4e14ac46a7b

4/3/2013 4:50:14 PM

lewisje
All American
9196 Posts
user info
edit post

Force Compatibility Mode or Quirks Mode.

4/3/2013 9:44:18 PM

Noen
All American
31346 Posts
user info
edit post

Quote :
"You see the part where the parameter being passed is optionWin?"


Is that the value of the parameter or the variable? The VALUE of the parameter cannot contain spaces. You didn't specify what optionWin was, hence my reply

4/9/2013 3:51:56 PM

EuroTitToss
All American
4790 Posts
user info
edit post

Quote :
"You can please some of the IEs some of the time, but you can't please all of the IEs all of the time."

4/9/2013 4:19:18 PM

Stein
All American
19842 Posts
user info
edit post

Post your code, amigo.

4/9/2013 6:25:55 PM

FroshKiller
All American
51911 Posts
user info
edit post

It's not mine, just what I'm supporting here. Here is the line in question:

optionWin = window.open('scriptname.ext?arg1=foo&arg22=' + bar, 'optionWin', 'toolbar=no,resizable=yes,location=no,scrollbars=no,height=300,width=400,left=0,top=0,alwaysraised=yes');


I've anonymized the URL being opened, which is the first parameter of window.open, but you can see the name passed for the window is just the string literal optionWin. There aren't a lot of moving parts here. It has nothing to do with the window options being passed in the third parameter, nothing to do with the URL in the first parameter, nothing to do with the fact that the return value is being assigned to a variable that coincidentally has the same name. I could strip it down to this and run it in the console:

window.open('http://www.google.com', 'optionWin', '');

Same result. No window opens.

[Edited on April 10, 2013 at 8:30 AM. Reason : ...]

4/10/2013 8:28:47 AM

BigMan157
no u
103354 Posts
user info
edit post

are you using window.close() to close the window, or are you closing it manually?

4/10/2013 8:38:35 AM

FroshKiller
All American
51911 Posts
user info
edit post

Manually, by clicking the X (as you do). I suspect there might be some funny business with the window manager not freeing the window handle or some such shit, so maybe the browser is actually trying to open the URL in this zombie window that isn't displaying, but I don't know why that'd be happening, how to identify whether it's happening, or how to fix it if it is happening.

4/10/2013 10:59:54 AM

BIGcementpon
Status Name
11318 Posts
user info
edit post

Sorry if I missed it somewhere, but is this on multiple systems, or are you only testing on one pc?

4/10/2013 11:26:42 AM

FroshKiller
All American
51911 Posts
user info
edit post

It's restricted to three machines in the client's environment. I've suggested just reimaging the damn things.

4/10/2013 12:29:30 PM

Shaggy
All American
17820 Posts
user info
edit post

if you're sure its only those 3 machines, then its definitely a problem with some software they've installed on there. probably an AV that's got hooks into IE and is fucking up popups.

4/10/2013 1:08:29 PM

Wolfmarsh
What?
5975 Posts
user info
edit post

I've had javascript go "dead" on several machines. I use dead in quotes because javascript seems to work fine and is installed properly, except sometimes it just dies on me and wont work anymore until I reboot.

Chrome on the same machines continues to work with js. The problem always seems to stay localized to IE when it happens to me.

4/10/2013 4:13:20 PM

BIGcementpon
Status Name
11318 Posts
user info
edit post

Basically, IE sucks bawlz

4/10/2013 4:15:22 PM

wdprice3
BinaryBuffonary
45912 Posts
user info
edit post

Did you check your TCP/IP settings?

4/10/2013 4:48:18 PM

FroshKiller
All American
51911 Posts
user info
edit post

Update: The client elected to make his users access the application through Internet Explorer via Terminal Server. I don't understand that, but whatever, case closed.

New case, same issue, different client. WTF?

4/22/2013 11:15:13 AM

Shaggy
All American
17820 Posts
user info
edit post

couldn't replicate it on any machine in ie9/10. box pops erry time. its almost certainly some av software that's also got a broken popup blocker built in.

4/22/2013 11:25:52 AM

 Message Boards » Tech Talk » JavaScript window.open not working in IE9 Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.