Source Code
<html>
<head>
<script language="JavaScript">
timerID = 10;
tm = 10000;
count = tm / 1000 - 1;
function NNCheck(version) {
if((navigator.appName.indexOf('Netscape') >= 0)
&& (version <= parseInt(navigator.appVersion.substring(0, 3)))) {
return true;
} else {
return false;
}
}
function Func() {
ret = setTimeout("location.href = location.href", tm);
return ret;
}
function TimerX() {
status = count--;
}
</script>
</head>
<body onload="ret=Func();timerID=setInterval('TimerX()',1000)">
<script language="JavaScript">
col1 = new Array("#000000", "#808080", "#c0c0c0", "#ffffff",
"#ff0000", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff",
"#800000", "#808000", "#008000", "#008080", "#000080", "#800080");
col2 = new Array("black", "gray", "silver", "white",
"red", "yellow", "lime", "aqua", "blue", "fuchsia",
"maroon", "olive", "green", "teal", "navy", "purple");
if(NNCheck(1)) {
btn = 'Reload';
} else {
btn = 'Renewal';
}
doc = '<p>This page is renewed in every ' + tm / 1000 + ' seconds.<\/p>';
doc += '<p>It is renewed even if "' + btn + '" of browser is pushed.<\/p>';
num = Math.floor(Math.random() * 16) % 16;
col = col2[num] + ' (' + col1[num].toUpperCase() + ')';
doc += '<p>';
doc += 'C<SMALL>HARACTER</SMALL> C<SMALL>OLOR</SMALL>.'.fontcolor(col1[num]).fontsize('+5').bold();
doc += '<\/p>';
doc += '<p>A present color is ' + col + '.<\/p>';
doc += '<form name="myForm">';
doc += '<input type="button" name="myButton" value="Stop!" ';
doc += 'onclick="clearTimeout(ret);clearInterval(timerID);document.myForm.myButton.value=\'!?\'">';
doc += '<\/form>';
doc += '<p>It stops when you push an upper button, being renewed.<\/p>';
doc += '<p>It comes to be renewed again when you push "' + btn + '" of browser.<\/p>';
document.write(doc);
</script>
</body>
</html>