javascript - why is my banner refusing to rotate? -
javascript - why is my banner refusing to rotate? -
it seems followed directions in assignment powerpoint, checked if using each function right, tripple checked spelling, , have no thought why wont work, i'm new javascript, tried debugging top bottom, seems making script not work, or doing wrong together. doing wrong code?
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>rollover banner </title> <script language="javascript"> <!-- variable declaration --> if (document.images) { var photos = new array (“images1/nj1.jpg”,”images1/nj2.jpg”,”images1/dice1.jpg”); var photourls = new array (“msn.com”,”imdb.com”,”tv.com”); } var = 0; function newlocation() { document.location.href="http://www." + photourls[i]; } function rotate() { = math.floor(math.random()*3); document.banner.src = photos[i]; document.write(i); //doesnt settimeout("rotate()", 1000); } </script> </head> <body > <a href="javascript:newlocation()"> <!--doesnt direct --> <img src="images1/nj2.jpg" name="banner"> <!--loads --> </a> <script language="javascript"> rotate(); </script> </body> </html>
make sure not using smart quotes in arrays. seek retyping " character, if looks normal.
smart quotes annoying issue developers alike.
addition: find , replace feature helpful this.
javascript html
Comments
Post a Comment