jQuery(document).ready(function() { var clock_fcj = function() { var _curDate = new Date(); var _nextHour = _curDate.getHours() + 1; var _nowMinutes = 60 - _curDate.getMinutes(); var _nowSeconds = 60 - _curDate.getSeconds(); _nowMinutes = ( _nowMinutes < 10 ) ? _nowMinutes = "0" + _nowMinutes : _nowMinutes; _nowSeconds = ( _nowSeconds < 10 ) ? _nowSeconds = "0" + _nowSeconds : _nowSeconds; jQuery("#clock").replaceWith( "reset apache'a " + _nowMinutes + ":" + _nowSeconds ); setTimeout( "clock_fcj", 1000 ); } clock_fcj(); });
i on powinien wyświetlać odliczający "zegarek" w divie i częściowo to działa bo po załadowaniu strony pokazuje ilość minut:sekund ale po przejściu pierwszej pętli setTimeout w FireBug'u znajduje taki komunikat:
Cytat("FireBug")
clock_fcj is not defined
setTimeout( "clock_fcj", 1000 );
setTimeout( "clock_fcj", 1000 );
czy ktoś może mi powiedzieć co ja robię źle ?