views:

283

answers:

7

How to make pop up blockers allow your popup windows?

+3  A: 

Users have to set that manually. Imagine what would happen if web apps were allowed to override popup blockers.

Raj Kaimal
+9  A: 

In general, by popping them up from within the event handler of a user-generated event. For instance, if you have a link and the user explicitly clicks it and you raise a popup from the onclick handler on the link, most popup blockers will allow the popup because of the user's explicit action. In contrast, popups from the window.load event, or code executing as a result of a setTimeout or setInterval call, will typically be suppressed.

Somewhat OT, but: If you can avoid using a pop-up, I would. I'd say (unscientifically) that 95-99% or so of the use-cases where people think they need a pop-up, there's a better design solution. But the answer above is there for those 1-5% situations. :-)

T.J. Crowder
@downvoter: Care to help by saying *why* you downvoted? Factual error? You don't like people answering a question about popups? It's downvote Wednesday and no one told me? ;-)
T.J. Crowder
@T.J. It's downvote Wednesday? That explains the anonymous downvote I got earlier. Does that mean we get 2 for 1 movie tickets at the expense of having our answers downvoted? ;-)
Andy E
@T.J. It's Wednesday? Shit I missed Justified last night.
Rob
@Andy E's head: LOL! :-)
T.J. Crowder
Hmm...suddenly I got down-voted on a few of my questions that are quite old. I feel a vigilante in the works.
Diodeus
+4  A: 

You can't. It's up to the user to configure their software to allow pop ups. As a general rule, pop ups generated by user input (i.e. clicking on a button) is usually allowed by most pop up blockers. But this isn't a definitive rule and we can't change it programmatically. If we could it would make pop up blockers useless.

John Conde
+2  A: 

In your own browser … it depends on the browser and/or third party popup blocker.

When you have no control over the client — open the popup in response to a user generated event (such as onclick).

David Dorward
This is evil, and you know it.
Robusto
Popups in response to user generated events are not evil. Ugly? Yes. Usually a suboptimal design? Absolutely. Evil? No.
David Dorward
The word "evil" is used far too freely these days.
Andy E
I prefer "ebil"
fudgey
+3  A: 

Display a message nicely asking the user to unblock your popups. Obviously the whole point to popup blockers is so you, the site developer, can't forcibly defeat them.

Chris S
+4  A: 

You should use a jQuery UI Dialog, which the popup blocker will not affect.

SLaks
he is asking about popup windows but dialog box
Starx
What are you talking about?
SLaks
+2  A: 

One solution is to make them appear on your page rather than as an actual pop-up (which you can do pretty easily with jquery). If that's not appropriate in your case, asking nicely is a good option.

Eric Mickelsen