title: setInterval() does not work with onreadystatechange
body: <p>setInterval() does not work correctly when AJAX call is made. Here is the code</p>
  <pre><code>  xhttp.onreadystatechange = function() {
       
      document.getElementsByTagName('body')[0].innerHTML += this.responseText;
      clearInterval(downloadTimer);
      document.getElementsByTagName('body')[0].style=&quot;pointer-events:none;background: linear-gradient(#000000, #4a4949);height: 100%;margin: 0;background-repeat: no-repeat;background-attachment: fixed;&quot;;
      var sub = setInterval(alert('Hello'),3000);
    };
  </code></pre>
  <p>The problem is with var sub, it should show alert box after 3s, but it shows it right after AJAX call. It does not wait even a sec, I tried to put bigger value than 3000, but the result is the same. I've also  tried to use setTimeout, but the result is the same. Any help is more than welcome!
  Kind Regards</p>
  <p>P.S. Everything else in this block works just fine.</p>