var status; var miles = 2000; var togo = 2000; var day = 1; var interval; //Miles, day, and togo are normally constantly changing. function checkstatus(){ if(miles == 2000){ clearInterval(interval); //It doesnt even get here document.getElementById("status").innerHTML="Status: At the place!"; alert("You've reached the place!!"); } } function wGo(){ clearInterval(interval); document.getElementById("status").innerHTML="Status: Moving"; interval = setInterval(function(){checkstatus();},5000); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)