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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -