Пример:
До перехода на ГЛАВНУЮ СТРАНИЦУ осталось: 60,59,58, т.д
Вот код:
Code
<html>
<head>
<SCRIPT language=JavaScript>
var intLeft = 60; // Seconds until navigation occurs
function leavePage() {
if (0 == intLeft) // Time is up--navigate.
location.replace("http://www.softpurgen.narod.ru/")
else {
// Count down and output updated time by
// changing the contents of the element.
intLeft -= 1;
document.all.countdown.innerText = intLeft + " ";
// Wait another second.
setTimeout("leavePage()", 1000);
}
}
</SCRIPT>
</head>
<BODY onload="setTimeout('leavePage()', 1000)">
До перехода на SOFTPURGEN осталось:
<SPAN id=countdown><!-- Output initial amount of time. -->
<SCRIPT language=JavaScript>
document.write(intLeft);
</SCRIPT>
</SPAN>
</body>
</html>