Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] setInterval i proste odliczanie czasu
-EdeusEx~-
post 24.05.2008, 13:43:04
Post #1





Goście







Mam kod js:
Cytat
<script>
function timerOn(string) {
explode = string.split(":");
custom_date = explode[0];
custom_minutes = explode[1];
custom_seconds = explode[2];

cDate = new Date();
Hours = cDate.getHours();
Minutes = cDate.getMinutes();
Seconds = cDate.getSeconds();
document.getElemenById('time').innerHTML = Hours+':'+Minutes+':'+Seconds;
}

setInterval(timerOn, 1000);
</script>


Oraz HTML dokładnie pod tym:
Cytat
<body onLoad="timerOn('{$time}')">
<input type="hidden" id="timer_begin" value="{$time}">
<table width="70%" align="center">
<tr><td align="center" width="86%"><B>{$action_title}</B></td> <td><img src="icons/small/clock.png"> <div id="time"></div></tr>
<tr><td style="padding: 5px 5px;" colspan="2">{$text}</td></tr>
</table>


pytania:

1. dlaczego pisze, ze "string.split nie jest funkcja" ?
2. jezeli wywale nawet czesc rozwalania stringa, bedzie "document.getElementById nie jest funkcją"
3. czy ktos to umie naprawic?
Go to the top of the page
+Quote Post

Posty w temacie
- EdeusEx~   [JavaScript] setInterval i proste odliczanie czasu   24.05.2008, 13:43:04
- - lord_t   1. tego to nie wiem 2. bo masz '..Elemen.....   24.05.2008, 14:00:59
- - -EdeusEx~-   Dobrze, literówki nie zauwazylem, ale co w takim r...   24.05.2008, 14:47:24


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 17:08