0

i have a script and would like to say that it has to wait X TIME before it operates again.
i dont know if iam worng with my script:

if(document.body.innerHTML.search(/(E|e)rror/) == -1)
 {
 if(document.body.innerHTML.search(/Submit/) == -1){
   if(document.body.innerHTML.search(/XXXXX/) != -1) {
     window.location = "XXXXX"
   }
   if(window.location.pathname == "XXXXX") {
     if(document.body.innerHTML.search(/XXXXX/) != -1) {
       window.location = "XXXXX"
     }
      function myFunction(){
     doSomething();
     setTimeout(function(){doSomethingElse();}, 5500);
     }
     inputs = document.getElementsByTagName("input")
     for(i = 0; i < inputs.length; i++) {
       if(inputs[i].value == "XXXXX") { inputs[i].click() }
     }
   }
 }
 else {
   alert("XXXXX")
 }
 }
 else
 {
 window.location = "XXXXX"
 }
2
Contributors
1
Reply
12
Views
4 Years
Discussion Span
Last Post by EvolutionFallen
0

Pretty sure you can't declare a function inside a block of code. And even if you could, why would you in this case? Also, your comment says you want to run this again, so I assume doSomethingElse() is the function we're in? You should consider using setInterval() instead, outside this block of code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.