How to prevent popup blocking to return ajax post?

Asked

Viewed 561 times

2

Follows code:

JS:

function OnSuccess() {
    var url = "/Controller/VisualizarBoleto/" + 00;
    window.open(url, "WindowPopup", 'width=668,height=780');
}

inserir a descrição da imagem aqui

The problem is not displaying popup, the browser is blocking.

I know you can unlock using the browser setting.

There is another way without going in the browser settings ?

Because a "rookie" who doesn’t know what’s going on with.(popup blocked) site, he’ll never know if it’s blocked. So I asked a question of how to prevent popup blocking.

I made a small example: http://jsfiddle.net/WQXXT/5171/

How can I avoid that ?

  • Here is funfando, you have to see if your browser is not blocked pop up in settings

  • By browser setting works, there is no way without relying on browser config ?

1 answer

4


It seems that popup Blockers always try to bar when the popup is not the result of a user action.

A possible solution is to remove its function window.open from within the OnSuccess and move to a button.

Example in jsfiddle

Another option would be to try using an iframe, which can override other elements on the page, and is not blocked by browsers.

See an example using iframe

And I guess you can’t help but quote an option "ready":

The modal of Bootstrap.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.