JS setTimeout() alternative
<p>Like i explain <a href="http://blog.mlefree.com/2016/02/settimeout-alternative-as-happy-new.html" rel="nofollow noreferrer">here</a> , i can't use window.setTimeout() anymore and any window classical functions like clearInterval etc ...); but i need calling a JS block code as an async one.</p>

<p>That's why i used XHR request.</p>

<p>What is the best way to implement a smart alternative to window.setTimeout() with XHR ? </p>

<pre><code>// Not working :(
setTimeout(function(){ 
  document.getElementById("messageTimer").innerHTML = "Happy New Year ! (old version)";
}, 10);

// with or without jQuery - but XHR
jQuery.ajax({
    url: "/local/url/easy",
    success: function(html, textStatus, jqXHR) {
            // a loop ?
            // timeout done ?
            document.getElementById("messageTimer").innerHTML = "Happy New Year ! (working version)"
 }});
</code></pre>

<p>My fiddle test : <a href="https://jsfiddle.net/mlefree/xzh3w2we/" rel="nofollow noreferrer">https://jsfiddle.net/mlefree/xzh3w2we/</a></p>

<p>Tks</p>