So I have this script.
if (content == same){
wait=wait+1;
}
if (wait > 10){
polltime = 6000;
}
if (content != same){
$('#mydiv').load('content.php');
}
}, 2000);
This works fine and there isnt any issue. However, if I try change the number 2000 to "polltime" like this
if (content == same){
wait=wait+1;
}
if (wait > 10){
polltime = 6000;
}
if (content != same){
$('#mydiv').load('content.php');
}
}, polltime);
the script stops running. How do I utilize the variable like this? Sorry for this question, I am new to JQuery!
polltimeshould have a value whenwait <= 10if (content == same): you had better include that too, because the last row of your code forces me to think that the problem is related to what is acting before your initialifstatement!setInterval()call? AsetTimeout()? Where and when ispolltimedeclared and initialized?