Hi I have the following function:
Main.prototype.checkProcess = function () {
var $this = this;
if (document.cookie.indexOf("process=done") != -1) {
// close the active window
$('#processModal').modal('hide');
document.cookie = "process=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
return;
}
$this.$timer = setTimeout($this.checkProcess, 1000);
},
I have a timer every 1000 seconds that calls again the same function but it works only the first time, after that the function is never called again.
Any clue?