Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javascript

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?

like image 368
powerboy Avatar asked Nov 11 '10 03:11

powerboy


2 Answers

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

like image 177
Christos Pontikis Avatar answered Oct 31 '22 12:10

Christos Pontikis


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.

like image 23
casablanca Avatar answered Oct 31 '22 12:10

casablanca