所以我在函數之外聲明空白變量。setTimeout導致Uncaught TypeError:數字不是函數
//To be Timeouts
var progressionTimer;
var nextTimer;
var cycleTimer;
,然後內但是這些聲明的一個被稱爲
nextTimer();
我在Chrome控制檯每次函數
progressionTimer = setTimout(loadNextFunction, 2000);
progressionTimer();
nextTimer = setTimeout(loadOutsideFunction, 2000);
nextTimer();
//etc
/火狐/等本
Uncaught TypeError: number is not a function
填充
它的功能ns完全按照預期和clearTimeout工作沒有問題,但控制檯錯誤只是令我沮喪,任何人都可以解決這個問題,而不失去功能,仍然有clearTimeout工作?
的返回值,它是一個id爲您將傳遞給clearTimout以清除它的超時。 – 2015-02-10 23:45:22