4 ms·
It's not terribly complicated JavaScript. A pop-behind is generally done by calling Window.open() to open a new window, then Window.focus() to re-focus the orig
by f2n 9y ago
It's not terribly complicated JavaScript. A pop-behind is generally done by calling Window.open() to open a new window, then Window.focus() to re-focus the original window. Another method I've seen is opening a pop-up with the original site, then redirecting the original window to the advertising site. The MDN page for Window.open()[0] actually mentions some of the restrictions around opening windows and focusing other windows that have been added to browsers.
[0] https://developer.mozilla.org/en-US/docs/Web/API/Window/open https://developer.mozilla.org/en-US/docs/Web/API/Window/open