boopsie
asked on
Random META Refresh 30-90seconds
Is there any way to create a random interval in the META refresh tag?
I would like the same page on my own server to RANDOMLY refresh every 30 to 90 seconds.
I would like the same page on my own server to RANDOMLY refresh every 30 to 90 seconds.
Whoops - slight mistake change:
randVal = (Math.round(Math.random()* (10-5)))+5 ;;
to:
randVal = (Math.round(Math.random()* (90-30)))+ 30;
I just used smaller numbers while testing it. :o)
Ant
randVal = (Math.round(Math.random()*
to:
randVal = (Math.round(Math.random()*
I just used smaller numbers while testing it. :o)
Ant
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I was thinking of that James, but (I might be getting confused with something else) I wasn't convinced it would work....especially in different browsers.
Ant
Ant
Well it works in Internet Explorer and Netscape which is good enough for me - document.write() is usually pretty reliable when loading the page. But if you're going to use JavaScript at all, you might as well use the window.setTimeout() approach.
ASKER
Thank you James, it works perfect!
I've tacked on an extra 100 for a job well done.
I've tacked on an extra 100 for a job well done.
1 - Use server side scripting to generate the META tag - let us know what you have available and then we can put a solution together for you.
2 - Use javascript:
<html>
<head>
<script language="javascript">
<!--
refreshString = "window.location.reload();
randVal = (Math.round(Math.random()*
window.setTimeout(refreshS
//-->
</script>
</head>
<body>
hello!
</body>
</html>
:o)
Ant