JavaScript Trigger window.open When a User Clicks Anywhere on Page
- by Joe Hammonds
I have a problem that I have been trying to figure out and haven't been able to get past it because Chrome/FireFox/IE do not publicly publish their "rules" for pop up blocking when it comes to JavaScript, Flash, etc. I am trying to trigger a window.open() when a user clicks anywhere on page. I've tried this:
document.onclick = window.open("http://msn.com");
But all 3 browsers are blocking the popup, even though it is a user interaction.