Hi, I have this error, and I have no idea where I went wrong.
I’ll post the full html code because I doubt it’s just an error within the javascript.
The error is Line 16 Col 5, which is “var puppies = new Array(6);”
It’s an animation sequence, but for some reason it doesn’t work. Also, when I change onload to onload=”loadAll()” and wrap that function around my entire javascript code, it tells me I need a bracket “)” after the function end bracket “}”
It’s really weird… maybe someone can mess around with it and get back to me?
[QUOTE]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<html xmlns=”[URL]http://www.w3.org/1999/xhtml
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link rel=”stylesheet” href=”./styles/dices.css” type=”text/css” />
<title>Run Puppy Run!</title>
</head>
<body onload=”setInterval(“puppyRun()”, 25)”>
<img id=”puppyrun” style=”position: relative;left: inherit;” src=”./images/puppy/puppy0.gif” alt=”A puppy is running” />
<script type=”text/javascript”>
/* <![CDATA[
var puppies = new Array(6);
var puppy = document.getElementsByTagName(“img”)[0].src;
var aniCount = 0;
puppies[0] = “./images/puppy/puppy0.gif”;
puppies[1] = “./images/puppy/puppy1.gif”;
puppies[2] = “./images/puppy/puppy2.gif”;
puppies[3] = “./images/puppy/puppy3.gif”;
puppies[4] = “./images/puppy/puppy4.gif”;
puppies[5] = “./images/puppy/puppy5.gif”;
function puppyRun(){
if (aniCount > 5)
aniCount = 0;
else
++aniCount;
puppy = puppies[aniCount].src;
} // puppyRun()
/* ]]> */
</script>
</body>
</html>