[thelist] Javascript Error

Warden, Matt mwarden at odyssey-design.com
Sun Feb 4 12:50: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>

Well, first of all, you never closed your HTML comment. You have:

<!-- Begin

but no

// end -->

Most likely, your problem is a missing (or actually probably an extra) } or
 in the if... then... else conditionals you added. Feel free to send the
entire script my way and I'll see what I can do.




--
mattwarden
mattwarden.com





More information about the thelist mailing list