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 - CUDA code not processing if block properly -

oracle11g - get root domain from url Oracle sql regex_substr -

xcode - Swift Playground - Files are not readable -