Hi,
> It's as if the
> ajax.responders onComplete method isn't called.
Sorry, this is one of my pet peeves: Surely it would take seconds to
modify your code to find out for sure whether it is, rather than
speculating? ;-)
> however it does not work with synchronous
> requests.
I don't see any synchronous requests in the code you quoted.
Ajax.Request defaults to asynchronous unless you specify
"asynchronous: false" in the options. Synchronous requests are a very
bad idea; they completely freeze the UI of most browsers, so you're
best off continuing to leave the option out.
> any idea what i'm doing wrong?
Looking at that code, what if you have more than one request running
at a time? (And you do, in the code you posted, assuming menu.num is
at least 2.) Since you're using a global for the timer, Request A can
create a timer that gets started, then Request B starts a second timer
(overwriting the reference to the one created by Request A), then
Request A completes and clears Request B's timer -- Request A's timer
is left in limbo. You might want to only create the timer if it
hasn't already been created, and in the complete callback, use the
counter maintained by Prototype (discussed on the responders page[1])
to decide whether to stop it. Or use your own counter within the
timer, whatever route you want to go. I think if you look into those
issues a bit, the answer's probably somewhere in that area.
[1]
http://prototypejs.org/api/ajax/responders
HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available