I am trying to use setInterval and clearInterval in literally the simplest case possible:
var passiveInterval = "";
var activeInterval = "";
function myStartFunction()
{
...
passiveInterval = window.setInterval(passiveCheck, pIntAmt);
activeInterval = window.setInterval(activeCheck, aIntAmt);
...
}
function myEndFunction()
{
...
if (passiveInterval != "")
{
alert("passiveInterval: " + passiveInterval);
window.clearInterval(passiveItnerval);
passiveInterval = "";
}
if (activeInterval != "")
{
window.clearInterval(activeInterval);
activeInterval = "";
}
...
}
The incredible thing is that the alert triggers, and gives me the correct value of the interval (an integer), but then the clearInterval statement triggers:
ReferenceError: Can't find variable: passiveItnerval
I have tried this with every permutation of window and this slapped on the front of everything, but nothing works...