js中的延遲執行和定時執行

在js中,延遲執行函數有兩種,setTimeout和setInterval,用法以下: setTimeout( "testFunction()" , "6000" );  //6000毫秒後執行testFunction()函數,只執行一次。 setInterval( "testFunction()" , "6000" ); //每隔6000毫秒執行一次testFunction()函數,執行無數次。
相關文章
相關標籤/搜索