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 Window open Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Window open " Watch "Window open " New topic

Window open

Christian Flory

Joined: Jun 01, 2012
Posts: 1

it was a few years since I used javascript but for a study i want to use a javascript function, which opens a new window to launch questions for the users, who leave the homepage.

When this function is called on unload, the alert (to test the function) pops up, but the window doesn't - both with IE and FF (although in IE it works locally on my computer !?!):

FF tells me "winout is null winout.focus();"

Here's the code from js-File:

and HTML page:

Thanks in advance.


Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Modern day browsers block any pop up that is not initiated by a user.

I agree. Here's the link:
subject: Window open
It's not a secret anymore!