JS: open new tab from fn callback (open in new window, without tab)

window.open(window.location + 'pdf?' + Ext.urlEncode(params));

When I call it from the plan code, it opens normally in a new tab. When I want to open it from callback (interaction with the server), it wants to open it in a new window (not a tab). How to fix it?

I have an Api class. When i do

Api.getDetail( function (response) { ... })

it goes to the server and then processes this callback. I need to call a window from this callback.

+3
source share
2 answers

Solution: we need to create a window before the callback function: var win = window.open. And then in the callback we can change the location of this window.

+4
source

This is the behavior of the browser and you cannot control it.

window.open , , .

0

All Articles