Click here to Skip to main content
Licence 
First Posted 26 Dec 2001
Views 146,261
Bookmarked 35 times

Creating a pop-under window

By | 26 Dec 2001 | Article
This tutorial shows you how to create a popunder window using JavaScript

Creating a pop-under window

I feel guilty writing this tutorial, but as the saying goes, "give the people what they want", or to be more precise, developers. A lot of developers would like to know how to implement pop-under windows on their site as a way to broadcast advertising. Yes it's annoying for the visitor, but proven quite effective in getting attention.

Creating a pop-under window is very simple, by using JavaScript. Basically one would use the same method for creating a popup window, but then "un-focus" it. Here is the code in full force:

<script>
win2=window.open("http://www.msn.com")
win2.blur()
window.focus()
</script>

That's it! I open a window by invoking window.open(), blur it, then redirect the focus to the main window instead. Translation - the popup window becomes a pop-under instead.

You've probably seen more sophisticated pop-under scripts that control the "frequency" of the pop-under, such as popping up only once per browser session. Instead of reinventing the wheel, I'll simply point you to a nice example of this on JavaScript Kit: http://javascriptkit.com/script/script2/popunder.shtml

Have fun with popping under your windows.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Mike Thompson

Web Developer

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralCute Cool Pop-Ups Pinmemberravindu_d15:59 15 Aug '07  
GeneralPopUnder arent always bad PinmemberSeth Illgard17:06 8 Feb '07  
Generalalert box in javascript PinmemberPrakashBhaskar2:42 16 Jun '06  
GeneralRe: alert box in javascript PinmemberJeevaBharathi23:33 15 May '07  
Generalpopup - very urgent Pinmemberdeulu20:49 31 Oct '05  
GeneralRe: popup - very urgent Pinmemberwuxsh13:33 18 Jan '06  
GeneralRe: popup - very urgent Pinmemberravindu_d14:00 15 Aug '07  
GeneralSome Good Resources PinsussAnonymous17:33 19 Aug '05  
GeneralRe: Some Good Resources Pinmemberravindu_d14:14 15 Aug '07  
GeneralPopup window issues... PinmemberBBWS1O9:54 6 Jun '05  
GeneralRe: Popup window issues... PinmemberBrad Frere11:14 17 Jan '07  
Generalclose window Pinsusswing568516:10 1 Apr '04  
GeneralRe: close window PinsussAnonymous2:36 3 May '04  
GeneralRe: close window Pinmemberravindu_d14:11 15 Aug '07  
GeneralCode snippet PinmemberHockey18:20 29 Jan '04  
QuestionHow to develop a deeptree bar? Pinmemberwaifone18:48 22 May '03  
AnswerRe: How to develop a deeptree bar? Pinmemberravindu_d14:23 15 Aug '07  
GeneralPopup window PinmemberQuintonvz1:48 24 Apr '03  
GeneralPop-up Window Eliminator PinsussAnonymous3:06 19 Jul '02  
Questionan unpopular topic eh? PinmemberNish [BusterBoy]19:34 28 Dec '01  
AnswerRe: an unpopular topic eh? PinmemberJörgen Sigvardsson20:34 7 Oct '02  
GeneralRe: an unpopular topic eh? PinsussAnonymous8:46 12 Feb '04  
GeneralRe: an unpopular topic eh? PinmemberJörgen Sigvardsson9:25 12 Feb '04  
GeneralRe: an unpopular topic eh? - test PinsussAnonymous5:38 12 Dec '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 27 Dec 2001
Article Copyright 2001 by Mike Thompson
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid