javascript - Uncaught ReferenceError: timerFunc is not defined -
function timerfunc() { alert("howdy"); settimeout("timerfunc()",5000); } timerfunc();
this simple function seems causing kind of trouble, idea why?
i'm getting "uncaught referenceerror: timerfunc not defined " error on chrome
use function name without quotes:
function timerfunc() { alert("howdy"); settimeout(timerfunc, 5000);//<-- quotes removed } timerfunc();
you can use setinterval
repetitive task:
function timerfunc() { alert("howdy"); } timerfunc(); setinterval(timerfunc, 5000);
Comments
Post a Comment