我在使用setInterval/clearInterval時遇到了問題。setInterval Spotify應用程序
我試過這樣做:int = setInterval(someFunction(), 1000);
但它只調用someFunction()
一次,而不是每秒一次?
所以我試圖做到這一點:int = setInterval("someFunction()", 1000);
它實際上以某種方式工作,因爲它每秒給我這個錯誤Uncaught ReferenceError: someFunction is not defined
?
爲什麼? d:
錯誤在'someFunction' – Eric 2012-01-10 23:34:01