Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Window open  RSS feed

 
Christian Flory
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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.

Chris



 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Modern day browsers block any pop up that is not initiated by a user.

Eric
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!