Forum Moderators: open
<html>
<head><title>Random Integer</title>
<script>var randMin = 10
var randMax = 100
var minutes = 3
function getRandomInt(min,max)
{
return Math.round(min + Math.random()*(max-min))
}window.onload = function()
{
setInterval
(
"document.getElementById('targ').innerHTML = getRandomInt(randMin,randMax)",
minutes*60000
)
}</script>
</head>
<body><p id="targ">Hello</p>
</body>
</html>
var minutes = 0.1 Come to think of it, this shouldn't be on a timer at all. To emulate a server-side thingy, it should just give one random figure per page visit/refresh.
The script changes the Hello text to the random number after this time. Have you waited for a full minute - (without refreshing)?