Rotate javascript after page exchange

0

Good morning. I developed a script to run on a particular webpage, an automation of actions.

[...]
if (codigo == codigo1) {
    processar(codigo2);
  } else {
    if (quantAldeias > 0) {
      $('.groupRight').click();
      var nextRun = confirm("Fazer?");
        if (nextRun == true) {
            processar(codigo1);
            quantAldeias--;
        };
     }
}
[...]

My intention is for it to execute $ ('groupRight'). , which triggers the exchange of the current page for another, and after opening the next page, block. What happens is that all code is fired, and nothing happens on the next page.

I tried to use:

setTimeout(function(){
         $(document).ready(function() {
         quantAldeias--;
         processar(codigo1);
       });
       }, 3000);

and window.onload, but they did not work. Can you help me?

    
asked by anonymous 04.04.2016 / 16:02

0 answers