Need unblockable pop under java code

I’m looking for javascript code that will open popuner window with URL (web page in it) when visitor open my site (on load) or on exit.

I want something that will pass firefox and all other popup blockers.

There is nothing that can bypass the blockers as the blockers are specifically designed to block windows opening in those situations.

The only way to bypass the blockers is to open the new window when your visitor clicks a link.

The only other way to do it is as a popin within the web page itself.

So, how to “open the new window when your visitor clicks a link.”

By attaching a function to the link’s onclick event from where you could use [url=“https://developer.mozilla.org/en/DOM/window.open”]window.open using the alwaysLowered setting to put the new window behind the current one.

<a href="www.google.com" target="_blank">LINK</a>

This will open in a new window.

EDIT:

By attaching a function to the link’s onclick event from where you could use window.open using the alwaysLowered setting to put the new window behind the current one.

Unless you want it always behind, in which case Paul’s got it right.

But should not be used because:

  1. target is deprecated and ceased to be a proper part of HTML back in 1997.
  2. Opening a new window is a behaviour and so should be done using JavaScript and not HTML.

The correct code for such a link (but jumbling the JavaScript with the HTML to make the comparison more obvious - rather than doing it properly with separate files the way you’d do it for a proper web page) is:

<a href="www.google.com" onclick="newwin window.open(this.href);newwin.blur();">LINK</a>

Of course since blur (and focus) are non-standard for windows it will depend on which browser your visitor is using as to which window will end up on top.

OH! Ha, sorry, good to know!! Thanks!