rabbitears
asked on
ONLOAD problem
is there a way to make the counter not start counting until the picture loads? i'm working on a web cam, but if load three seperate jpgs and only have a 15 second count, the page will try to refresh before the pics come down.. on a slow connection of course..
here's waht i'm doing..
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="15">
<title>Non-Java test</title>
</head>
<body ONLOAD="startClock()">
<img src="alex.jpg" ALT="SpyCam Video Window" width="320" height="240">
<img src="sloan.jpg" ALT="SpyCam Video Window" width="320" height="240">
<form NAME="form1">
<P>This page will reload in
<INPUT TYPE="text" NAME="clock" SIZE="3" VALUE=""> seconds.
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDING
var x = 16
var y = 1
function startClock(){
x = x-y
document.form1.clock.value = x
timerID = setTimeout("startClock()", 1000)
}
// END HIDING -->
</SCRIPT>
</body>
</html>
here's waht i'm doing..
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="15">
<title>Non-Java test</title>
</head>
<body ONLOAD="startClock()">
<img src="alex.jpg" ALT="SpyCam Video Window" width="320" height="240">
<img src="sloan.jpg" ALT="SpyCam Video Window" width="320" height="240">
<form NAME="form1">
<P>This page will reload in
<INPUT TYPE="text" NAME="clock" SIZE="3" VALUE=""> seconds.
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDING
var x = 16
var y = 1
function startClock(){
x = x-y
document.form1.clock.value
timerID = setTimeout("startClock()",
}
// END HIDING -->
</SCRIPT>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
will this work on any browser?
ASKER
will this work on any browser?
Yes this will work in all javascript enabled browsers!
-Josh
-Josh
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Non-Java test</title>
</head>
<body ONLOAD="startClock()">
<img src="alex.jpg" ALT="SpyCam Video Window" width="320" height="240">
<img src="sloan.jpg" ALT="SpyCam Video Window" width="320" height="240">
<form NAME="form1">
<P>This page will reload in
<INPUT TYPE="text" NAME="clock" SIZE="3" VALUE=""> seconds.
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDING
var x = 15;
function startClock()
{if (x<=0)
history.go(0);
document.form1.clock.value
timerID = setTimeout("startClock()",
}
// END HIDING -->
</SCRIPT>
</body>
</html>