Click to See Complete Forum and Search --> : new to js...help plea


anda001
07-08-2003, 08:26 AM
hallo and thx for popping in to help:)!!!

i'm not a rpogrammer at all....and i just leech on codes,thx for free codes to you as well.

i have a problem in using a mouseover js:

Mouse Banner by Peter Gerhig Dec. 29 1999 in A-Z scripts
of this site;it gives me an error in debug::

<--in the code that goes in the head-->

var thisspan = eval("document.span" + i);

warning 5002 var "thisspan" already defined...

??what does that mean??

my assumpition was that i had to change something in the line or to create that "document.span"and i've been looking around the web(dev.tut.in this site included)becouse even if i dunnov js at all at least i know few basics of apple script ...but no results...
:confused::confused::confused:

please can u send me a mail or post a message here thx.

freefall
07-08-2003, 08:47 AM
Probably if you checked through the rest of your code, you would see "var thisspan" more than once. The "var" is what initially makes this a variable. Once it's made, it remains a variable until the function or page is closed. So if you put "var thisspan" more than once, it confuses the browser.

After the first ever var thisspan =
the rest should be simply thisspan =

So your line should be
thisspan = eval("document.span" + i);

Hope that helps,
Ian