How to make pop up blockers allow your popup windows?
Users have to set that manually. Imagine what would happen if web apps were allowed to override popup blockers.
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. :-)
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.
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
).
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.
You should use a jQuery UI Dialog, which the popup blocker will not affect.
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.