jQuery in Action, 2nd edition
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 Elasticsearch in Action this week in the Big Data 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: 15379
Modern day browsers block any pop up that is not initiated by a user.

Don't get me started about those stupid light bulbs.
subject: Window open