munzie
asked on
image timer
I can not get this code to work, what am I doing wrong.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang = "en"
dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-
1" />
<title>ConcertAd</title>
<script type="text/javascript">
/*<![CDATA[ */
if (curImage == "concert2")
{
document.images[1].src = "concert1.gif";
curImage = "concert1";
}
else
}
document.images[2].src = "concert2.gif";
curImage="concert2";
}
/*]]>*/
</script>
</head>
<body onload ="var begin=setInterval ('changeImages( )', 5000);">
<p><img src="concert1.gif" alt=""/></p>
</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.
yes and you forgot to define:
var curImage="concert1";
var curImage="concert1";
ASKER
Thanks, I see what was wrong.
You are "opening" your else with "}":
else
}
It should be "{"
else
{