Link to home
Start Free TrialLog in
Avatar of munzie
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>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Lolly-Ink
Lolly-Ink
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hielo
>>what am I doing wrong.
You are "opening" your else with "}":
else
}


 It should be "{"
else
{
yes and you forgot to define:

var curImage="concert1";

Avatar of munzie
munzie

ASKER

Thanks, I see what was wrong.