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);
}

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:

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???
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.