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"
 }

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.