JS: setInterval and blur
<p>I have this:</p>

<pre><code>$(window).blur(function() {
    setInterval(function() {
        $.ajax({
            type: "POST",
            url: "imback.php",
            data: {
                mode: 'ajax',
                getUpdates: 'auto',
            },
            success: function(msg){
                document.title = msg + titleOrig;
            }
        });
    }, 35000);
</code></pre>

<p>Works fine.</p>

<p>Although, if you have been blur, and then when you focus back, it will keep making the ajax call, it doesnt stop sending ajax call after interval 35 seconds. </p>

<p>How can i fix this?
    })</p>
