File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes pop up window hides itself when parent is closed 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 "pop up window hides itself when parent is closed " Watch "pop up window hides itself when parent is closed " New topic
Author

pop up window hides itself when parent is closed

Kevin manoj
Ranch Hand

Joined: Jul 19, 2002
Posts: 36
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Pop up blockers...

Eric
Kevin manoj
Ranch Hand

Joined: Jul 19, 2002
Posts: 36
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

Joined: Oct 21, 2003
Posts: 247

Maybe the popup.blur() is the source of your problem


Mike Firkser
Rutgers '84
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: pop up window hides itself when parent is closed