I have a button that calls other 4 buttons via jquery, each button opens a new tab and is in load state until the pdf is downloaded automatically, I need to verify that this page has finished loading to call the other buttons. Any suggestions?
function gerarTodosRelatorios(){
jQuery('.button1').on('click', function (e) {
e.preventDefault();
var target = jQuery(".button2");
var target2 = jQuery(".button3");
var target3 = jQuery(".button4");
var target4 = jQuery(".button5");
target[0].click();
target2[0].click();
target3[0].click();
target4[0].click();
});}