Forum Moderators: open

Message Too Old, No Replies

refresh a frame every 1 sec

refresh a frame every 1 sec

         

MrGecko

7:39 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



How can i refresh a frame every 1 sec
with javascript

hellboy

11:15 am on Mar 10, 2007 (gmt 0)

10+ Year Member



HI, there it is, just a simple javascript which will reload your page after number of seconds set up in variable var Inertval Now set by default 120 seconds. Enjoy :))

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Cam 1 </title>

<SCRIPT language="JavaScript">
<!--
var Interval = 120
function startClock() {
Interval = Interval - 1
if (Interval == -1) {
window.location.reload()
}
else {
document.clock.time.value = Interval
timerID = setTimeout("startClock()", 1000)
}
}
//-->

</SCRIPT>
</head>

<body leftmargin="0" topmargin="0" onload="startClock()">
<FORM NAME="clock">

<INPUT TYPE="text" NAME="time" SIZE="3" VALUE="" style="border:0px; text-align:center; color:#FF0000; background-color:#cccccc; font-weight:bold; width:30px; "> seconds.
</form>

</body>
</html>

Tom_Ruskin

2:51 pm on Mar 10, 2007 (gmt 0)

10+ Year Member



Simply put this code beween the head tag of the frame. Content would specify the number of seconds after which the frame would refresh every time.
<meta http-equiv="refresh" content="100">

Tom_Ruskin

3:18 pm on Mar 10, 2007 (gmt 0)

10+ Year Member



Well sorry, I forgot to say, this is my first post and I'm glad to be here.

eelixduppy

3:21 pm on Mar 10, 2007 (gmt 0)



Welcome to WebmasterWorld, hellboy and Tom_Ruskin! Glad to have you! :)

hellboy

5:43 pm on Mar 10, 2007 (gmt 0)

10+ Year Member



Thx eelixduppy, I'm very glad to be here too, this is just a great place for those who are looking for some solutions,and also want to share their own stuff with the others :) I've been searching for a lot of stuff regarding to the web on the internet and I was always refered HERE :)so there was nothing else to do just sign up! :)