[thelist] Javascript Error

Michael Galvin mpgalvin at eircom.net
Sun Feb 4 07:35:37 CST 2001


I have some JS in a HTML file that looks like this:

<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var how_many_ads = 6;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads

ad +=1;

if (ad==1) {
url="http://www.achieversgroup.ie";
banner="tag.gif";
}

.
.
other if statements
.
.


if (ad==6) {
document.write ('<a
href=\"http://www.dooyoo.co.uk/servlets/Item2Connector?template=item&session
ID=&itemID=10733&sponsor=122870\" target=\"_top\"><img
src=\"http://www.dooyoo.co.uk/pix/banners/DYbutton.gif\"
border=\"0\"></a>');
}
else {
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src="' + banner + '"');
document.write('alt=\"click here!\" height="60" border=0></a> ');
}
</SCRIPT>

but when I run it, I get an error on the second-last line, the one
containing

}

all on its own.  The error is "Syntax Error" which is obviously a lot of
use.  This was running fine before I added some more if statements.





More information about the thelist mailing list