PDA

View Full Version : Pausing up-down Scroller - "undefined"



johnb
06-05-2006, 05:30 AM
Script: Pausing up-down Scroller

Hi Everyone

I have searched through the forum and found a few references to "Undefined" relevant to the Pausing up-down Scroller.

However, none appear to answer the problem I am having.

The scroller works, it's just that on the FIRST pass through, after the last item, you always get an 'UNDEFINED' message.

The scroller then works faultlessly, untill you change or refres a page.
This is frustrating more than anything.

In my case, the data for the scroller is being populated from an Access Database

View the site at CLICK HERE (http://www.jjriba.com.au/index.asp)

The site is under development at the moment and only one page exists in the scroller (right hand column - Current News). I have tried it with multiple pages with the same result.

TIA for any and all help

Regards, John

Jerol
06-05-2006, 05:45 PM
I also noticed the "undefined" and it happened when I had only one item in array [0] to scroll. So I added a 2nd item in array [1] that was only a space surrounded by quotes - sort of a null, if you will. That made the undefined go away.

However, the way the script won't start the 2nd item until the first scrolls off, that resulted in a long wait for the first item to recycle.

I think the script must not check for the end of the array until after it processes array [1], and maybe it should check earlier. If I'm reading your msg correctly, however, you tried it with more than array [0] loaded and got the same undefined problem. So there may be multiple causes of undefined.

Hopefully, an expert will comment.

johnb
06-05-2006, 11:08 PM
Hi Jerol

Thanks for the reply

Interesting, I had tested the scroller with more than 1 item, but just did it again, just to make sure and it works perfectly now with 2 News Items added.

Ok, hopefully that will allow someone with more experience with Javascript than me (and thats not hard) to pin point the spot that is causing this error.

I think it has to do with this section of the script, but I could be completely wrong here

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1

Now I have tried varying options with the math here and can't seem to get it to remove the 'undefined' message, so maybe I am completely off base, it just appears this could be the problem area

Hope someone can help resolve this. Whilst it may not seem much and it disappears with more than one item in the array, it would be nice to resolve.

TIA again.

John

johnb
06-07-2006, 03:20 AM
Ok, now this is getting wierd

Scroller on this site is working on FF, but all of a sudden I am getting Javascript errors on IE and the scroller does not work past the first pass.
This was working on IE yesterday ???

Any help would be appreciated.

Thanks, John

johnb
06-08-2006, 01:57 AM
OK, 1 thing fixed, now workign in IE again, removed a Ad Bloacker and it started working.

Only need to fix the Undefined now .... anybody?