File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Windows XP Popup blocking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Windows XP Popup blocking" Watch "Windows XP Popup blocking" New topic

Windows XP Popup blocking

Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32

I have a situation where I click on a href in my first jsp, say Test1.jsp and am redirected to Test2.jsp, which in turn opens a new window using from a javascript. This works fine when there is no popup blocker. Unfortunately, IE on Windows XP has popup blocker with medium severity and it blocks the new window. Here's how my code is:


NOTE: My original page has a menu item on clicking which, I will be redirected to Test2.jsp.


If you look at my code, I am calling the javascript function to open the window inside the <head> tag. I tried to put it in body onload too, but it didnot help either.

The reason I couldn't open the new window from Test1.jsp itself is, I want user to complete some test in the new window and then come back to a page that asks him to click on something to get the score. [I haven't put that refresh button code in test2.jsp, but just the skeletal code]

How do I go about opening the new window so that it is not treated as a popup?

Any help is appreciated.


[ January 09, 2006: Message edited by: Priyaa V Kumar ]

[ January 09, 2006: Message edited by: Priyaa V Kumar ]
[ January 09, 2006: Message edited by: Bear Bibeault ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Doesn't you whole purpose behind this question defeat what a pop up blocker is meant to do?

The solution is to tall the people to enable pop ups on the site or have them open it up from a link with the action of onclick.

Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
I would put a check there - if window did not open display a div in the middle of the page with a message about popup blocker and a link to hide this div and open a window.
[ January 09, 2006: Message edited by: Yuriy Fuksenko ]
Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32
Thanks for your replies, guys. I was able to overcome the problem by this approach.

In click event of test1.jsp open the new window with test2.jsp as target.
Then, in test2.jsp do the logic and then do a JSP redirect (or a javacript window.location.href) to the actual page you want to show on the new window.
I agree. Here's the link:
subject: Windows XP Popup blocking
It's not a secret anymore!