Rella
Rella

Reputation: 66975

How to make pop up blockers allow your popup windows?

How to make pop up blockers allow your popup windows?

Upvotes: 1

Views: 4719

Answers (7)

T.J. Crowder
T.J. Crowder

Reputation: 1075447

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. :-)

Upvotes: 11

Quentin
Quentin

Reputation: 944320

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).

Upvotes: 2

Eric Mickelsen
Eric Mickelsen

Reputation: 10377

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.

Upvotes: 2

SLaks
SLaks

Reputation: 888107

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

Upvotes: 4

Cerin
Cerin

Reputation: 64870

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.

Upvotes: 3

John Conde
John Conde

Reputation: 219894

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.

Upvotes: 4

Raj Kaimal
Raj Kaimal

Reputation: 8304

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

Upvotes: 4

Related Questions