0

Iam getting this error code ;Line 5, char 45, unterminated string constant code 800A03F7

with the ff script. Please help.

var thisAd = 0;

function rotate() {
 var adImages = new Array("images/green.gif",
  "images/red.gif","images/gre.gif","images/
  apple2.gif");
 thisAd++;
 if (thisAd == adImages.length) {
    thisAd = 0;
 }
 document.getElementById("adBanner").
  src = adImages[thisAd];
 setTimeout(rotate, 3 * 1000);
}

Edited by Ezzaral: Added code tags. Please use them to format all code that you post.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Taywin
0

I am getting an error code: Thread started in incorrect forum section; code 101

Looks like you were looking for the VB.Net or ASP.Net forums. :twisted:

0

The problem is on line 5, you end it with a slash '/' instead of a comma ','. Because your code has improper line break, your code is invalid. If you are not sure about line breaker or copy codes from others, you should try to merge all multiple-line code of the same statement into 1 line to avoid improper line break.

var thisAd = 0;

function rotate() {
 var adImages = new Array("images/green.gif","images/red.gif","images/gre.gif","images/apple2.gif");
 thisAd++;
 if (thisAd == adImages.length) {
    thisAd = 0;
 }
 document.getElementById("adBanner").
  src = adImages[thisAd];
 setTimeout(rotate, 3 * 1000);  // <-- if you know the exact number, why not use 3000???
}

Edited by Taywin: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.