So I am working on a homework assignment using JavaScript the problem I am having is creating the changeAd() function to replace the starting image in the table with one of the other images in the function after 5 seconds. I am fairly lost so any help or pointers are greatly appreciated! This is what I have so far:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CVR1</title>
</head>
<body onLoad="startAdPage()">
<script type="text/javascript">
/* <![CDATA[ */
function startAdPage() {
setInterval(changAd(),5000);
setInterval(startCountdown(),1000);
}
function changeAd() {
THIS NEEDS WORK should change the image every 5 seconds to replace the one in the table, i think this needs to be an array/list
cvb1.gif;
cvb2.gif;
cvb3.gif;
}
var count() = 15;
function startCountdown() {
while count >= 0;
THIS NEEDS WORK
should change the value of textfield to countdown from 15 to 0 decrease by one each time it executes, when count reaches 0 clear both intervals and redirect browser to CVR2.html
}
/* ]]> */
</script>
<table>
<tr>
<td><img src="cvb1.gif"></td>
<td><p>Advertisement</p><p>The Central Vally Realtors home page will be displayed in TEXTFIELD seconds.</p><p><a href="CVR2.html">Skip Advertisement</a></p></td>
</tr>
</table>
</body>
</html>