Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pop up window hides itself when parent is closed

 
Kevin manoj
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently develop a program which need to pop out a window when the parent browser window is closed.

I write the function windowUnload in JSP as follow:
function windowUnload(evt) {
var popUnder = window.open("survey.jsp", "win", "width=610,height=550,scrollbars=yes,resizable=yes,status=yes");
popUnder.blur();
window.focus();
}

The result is that I can see the child window is popped out when I close the browser, but soon it hide itself.

Can someone explain what happen and how to make it show itself.

Thanks in advance
[ January 16, 2008: Message edited by: Bear Bibeault ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pop up blockers...

Eric
 
Kevin manoj
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked the browser. Blocker setting has been turned off.

I tried the sample code from http://www.javascript-coder.com/window-popup/javascript-popup-example4.html

It works fine on my computer and window is popped out.
But my survey window still did not show up
 
Mike Firkser
Ranch Hand
Posts: 249
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe the popup.blur() is the source of your problem
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you have some bad requirements to meet:

First: no one will see this survery since almost everyone in the world is using a pop up blocker. So it is a waste unless you expect that people are going to enable it for your site.

Second: I do not think I have ever filled out something that was popped up.

debug your code. Add an alert message, is it being called. Copy the esample and run it in the same location your code is at. Does that run?

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic