>
> As for those who suggested that I could somehow use onSuccess: in
> Ajax.Request to put off further processing until that event occurred,
> the answer is no, it doesn't wait. OnSuccess: function ()
> { doFutherProcessing() } will do the futher processing before the
> results of the CGI script are returned. I have thoroughly test this.
> So Success is apparently determined before the script's return values
> are available. Rude to be sure.
>
I see three possibilities.
1. You are mistaken
2. Your code isn't doing what you think it is doing
3. You have found a genuine bug, which none of the developers of
hundreds of sites (perhaps thousands) have encountered.
We can't help you any further until you show us what you
> It doesn't work. So I have to use setTimeOut() to get the proper
> delay to continue processing. And that works. But my setTimeOut()
> problems currently have nothing to do with Ajax.Request() and
> everything to do with CSS dropdown Menus that don't always want to
> stay open for the delay time I set.
It is not possible to use setTimeOut to get the proper delay, because
the proper delay depends on your server and the link to it. You might
get a timeout value which almost always works: but the next time you
do it, it may fail. That is why setTimeOut (and its Prototype cousin
function.delay()) is not the right tool here.
In response to your technical question:
> The thing is that setTimeOut takes two arguments, the thing you want
> to execute when the timer zeros and the the timer value setTimeOut
> ('thing', timervalue). Now how the heck does the 'thing', return a
> value that causes the timer to timeout quicker? I haven't found any
> doucmentation that says your function ( even a function with no return
> value ) can cause setTimeOut to do that.
It doesn't. It can't. The 'thing' doesn't run until the timeout
completes, so it can't possibly affect the timeout. You can save the
value of the timeout, and use that in other code to kill the timer:
var timer = setTimeOut(myFunc, 1.2);
...
if (condition)
clearTimeout(timer);
Colin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---