|
|
|
| Почему не работает?
<script language="JavaScript">
var curTime;
function showTime()
{
now = new Date();
day = now.getDate();
month = now.getMonth()+1;
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
curTime = month + "-" + day + "-" + hours + "-" + minutes + "-" + seconds;
setTimeout("showTime()",1000);
}
now = new Date();
window.status = curTime;
</script>
|
вобщем выводит "undifined" | |
|
|
|
|
|
|
|
для: Ильдар
(13.11.2007 в 16:45)
| |
<script language="JavaScript">
function showTime()
{
now = new Date();
day = now.getDate();
month = now.getMonth()+1;
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
curTime = month + "-" + day + "-" + hours + "-" + minutes + "-" + seconds;
window.status = curTime;
setTimeout("showTime()",1000);
}
showTime();
</script>
|
| |
|
|
|
|
|
|
|
для: sim5
(13.11.2007 в 17:22)
| | Теперь работает, но каждую секунду функция после window.status = curTime; не работает!!!
<script language="JavaScript">
var curTime;
function showTime()
{
now = new Date();
day = now.getDate();
month = now.getMonth()+1;
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
curTime = month + "-" + day + "-" + hours + "-" + minutes + "-" + seconds;
window.status = curTime;
setTimeout("showTime()",1000);
}
showTime();
window.status = curTime;
var aImages = new Array(2);
aImages[0] = new Image();
aImages[1] = new Image();
aImages[0].src = "rand.php?id=" + curTime; // здесь выводит, но не меняется
aImages[1].src = "rand.php?id=" + curTime; // здесь выводит, но не меняется
i = 0;
function rand()
{
document.tool.filters[0].Apply();
document.tool.src = aImages[i].src;
document.tool.filters[0].Play();
i = i + 1;
if (i == 2) i = 0;
setTimeout("rand()",5000);
}
</script>
|
| |
|
|
|
|
|
|
|
для: Ильдар
(13.11.2007 в 17:57)
| | Всё, справился! Подпряг мозги и заработала! | |
|
|
|
|
|
|
|
для: Ильдар
(13.11.2007 в 17:57)
| | А зачем вы дважды вообще выводите и что вы хотите - по этой переменной (времени) получать с сервера изображение? | |
|
|
|