En lille counter
Hvorfor virker dette ikke?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da">
<head>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
-->
</style>
<title>Tæller med setTimeout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<script type="text/javascript">
<!--
var counter = 1;
function opdatering() {
counter = counter + 1;
window.status="Tælleren er nu på: " + counter;
document.write("<span>" + counter + "</span>")
setTimeout("opdatering();", 1000);
}
-->
</script>
<script type="text/javascript">opdatering();</script>
<p align="right"><a href="#" onclick="window.close();">Luk viduet!</a></p>
</body>
</html>