1
I need to redirect a page with javascript after submitting a form, the problem is that this form opens in a new tab and after opening this new tab I need to redirect the original tab to a new address.
Using the code below I can’t do it:
$("#gerarBoletoForm").on('submit', function(){
window.location.replace('https://www.site.com.br/');
});
Not even if I use Location.href or Location.assign.
Is there any way to do that?
The problem is that I do not control the new tab, it is the bank tab of Brazil where the ticket is generated...
– Joel Piccoli da Rosa
When the ticket is generated the window closes? If yes, it is possible to catch this event.
– lfarroco
Don’t close @lfarroco
– Joel Piccoli da Rosa
The problem is that since the target site does not have the same origin (it is on the BB website), you cannot access the content by security (cross-origin). When this BB form is sent, is any of your servers notified? If yes, it would be possible to check through the original window.
– lfarroco