HighDots Forums  

DHTML Script Error - Undefined

alt.html.dhtml alt.html.dhtml


Discuss DHTML Script Error - Undefined in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Hanser
 
Posts: n/a

Default DHTML Script Error - Undefined - 04-11-2005 , 10:26 PM






I keep getting the word "undefined" displayed instead of the intended text
in the up-scrolling animated script located in the upper-left hand corner of
this work-in-progress:

http://www.marymoorvelodrome.org/new%5Fsite/index.html

Can anyone tell me what causes this? If I hit refresh, my intended text
comes back. Then, "undefined" appears, and repeats indefinitely.

Any help?

Thanks!



Reply With Quote
  #2  
Old   
Tom Hanser
 
Posts: n/a

Default Re: DHTML Script Error - Undefined - 04-12-2005 , 08:07 PM






Thanks, I'll give it a try.

I was afraid it was something to do with the fact that I only have two
messages out of potentially many more.

TH


"Safalra" <usenet (AT) safalra (DOT) com> wrote

Quote:
Tom Hanser wrote:
I keep getting the word "undefined" displayed instead of the intended
text
in the up-scrolling animated script located in the upper-left hand
corner of
this work-in-progress:

http://www.marymoorvelodrome.org/new%5Fsite/index.html

Can anyone tell me what causes this? If I hit refresh, my intended
text
comes back. Then, "undefined" appears, and repeats indefinitely.

It looks like it's getting confused by the fact you only have two
scrolling messages, and it's going past the end. Try replacing all
occurances of:

if (i==messages.length-1)

with:

if (i>=messages.length-1)

I don't promise it'll work though - it's obviously designed to have
more messages.

--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/




Reply With Quote
  #3  
Old   
Tom Hanser
 
Posts: n/a

Default Re: DHTML Script Error - Undefined - 04-12-2005 , 08:20 PM



Well, that did it!

Fixed!


"Safalra" <usenet (AT) safalra (DOT) com> wrote

Quote:
Tom Hanser wrote:
I keep getting the word "undefined" displayed instead of the intended
text
in the up-scrolling animated script located in the upper-left hand
corner of
this work-in-progress:

http://www.marymoorvelodrome.org/new%5Fsite/index.html

Can anyone tell me what causes this? If I hit refresh, my intended
text
comes back. Then, "undefined" appears, and repeats indefinitely.

It looks like it's getting confused by the fact you only have two
scrolling messages, and it's going past the end. Try replacing all
occurances of:

if (i==messages.length-1)

with:

if (i>=messages.length-1)

I don't promise it'll work though - it's obviously designed to have
more messages.

--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/




Reply With Quote
  #4  
Old   
Tom Hanser
 
Posts: n/a

Default Re: DHTML Script Error - Undefined - 04-14-2005 , 08:18 AM



Stephen:

Almost fixed. We ALMOST have it - I get only ONE "undefined", after
applying your fix and editing that one "if" statement. I can't see any
others to fix using Find-Replace

"Undefined" appears once, and then the regular text comes back.

Can you offer a suggestion? Or an alternative method of displaying this
scrolling text?

Thanks!



"Safalra" <usenet (AT) safalra (DOT) com> wrote

Quote:
Tom Hanser wrote:
"Safalra" <usenet (AT) safalra (DOT) com> wrote in message
news:1113296871.860594.73150 (AT) l41g2000cwc (DOT) googlegroups.com...
Tom Hanser wrote:
I keep getting the word "undefined" displayed instead of the
intended
text [...] in this work-in-progress:
http://www.marymoorvelodrome.org/new%5Fsite/index.html

[snip]
Try replacing all occurances of:
if (i==messages.length-1)
with:
if (i>=messages.length-1)

Well, that did it! Fixed!

Now if only all programmers would learn to use the correct
termination-conditions... [dreams of a world with well-named variables,
documentation, buffer overrun checks...]

--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.