jsの setInterval で not defined Error
以下のように書いたら大丈夫でした。
setInterval( countDown, 1000 ); function countDown(){ if(t>0) t--; if(t==0){ $('#counter').html('Go!' ); } else{ $('#counter').html( 'あと'+ String( t) + '秒で移動します'); } }
以下のように書いたら大丈夫でした。
setInterval( countDown, 1000 ); function countDown(){ if(t>0) t--; if(t==0){ $('#counter').html('Go!' ); } else{ $('#counter').html( 'あと'+ String( t) + '秒で移動します'); } }