PDA

View Full Version : every our diferent page


djdeeno31
10-22-2007, 10:29 AM
Hello, i know there is a javascript that works with iframe, thats every day shows a difrent page, example, on sunday he loads sunday.html etc but i search for a script thats do that with our, example, when its 1 our then he loads 1.html and when its 14:00 than he loads 14.html, can anyone tell me where i can found this scipt? or how i make this? thanks for support.
Greets from Amsterdam xx
natascha

coothead
10-23-2007, 05:15 AM
Hi there djdeeno31,

and a warm welcome to these forums. :agree:

This code will change the iframe src within a minute of the hourl...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
var check=60*1000; /* this value is equal to one minute */
window.onload=function() {
goThere();
}
function goThere() {
hr=new Date().getHours()+1;
document.getElementById('myIframe').src=hr+'.html';
setTimeout('goThere()',check);
}
</script>

</head>
<body>

<div>
<iframe id="myIframe"src="1.html"></iframe>
</div>

</body>
</html>
...except for those with javascript disabled who will only see 1.html or whatever page you choose to insert. ;)