$(setInterval (function() { if ( $("#online_counter").html() == 1) { $("wrapper").hide(); } if ( $("#online_counter").html() == 2) { window.location.replace(document.location.href); $("wrapper").show(); } }, 3000 )); Dear, is it possible to stop the execution of setInterval using jQuery when condition 2 is satisfied?
var timer = setInterval(...); clearInterval(timer);why, do you still overload the page? - Igor