powerboy
powerboy

Reputation: 10961

Popup a new window in an ajax success callback when popup blocker is on

I need to popup a new window (not a dialog inside the page or similar) after a ajax call succeeds. window.open() will be blocked by the popup blocker of browsers. So how to solve this?

Upvotes: 5

Views: 1422

Answers (3)

Christos Pontikis
Christos Pontikis

Reputation: 306

You can call window.open() not inside success callback, but after ajax call has been completed (using async: false)

Upvotes: 4

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262929

You probably should tell your users to whitelist your site in their browser's popup blocker.

Please realize that popup blockers would be useless if there was an easy way to do what you want, i.e. to circumvent them.

Upvotes: 1

casablanca
casablanca

Reputation: 70701

You can't. The best you can do is provide a notification link on the page when the call succeeds and open the popup when the user clicks on the link.

Upvotes: 1

Related Questions