On Mar 3, 2:55 am, Tobie Langel <tobie.lan...@gmail.com> wrote:
> Hi again, BearState.
>
> Your confusing different things here.
>
> The behaviour you are describing isn't related to memory leaks at all,
> your most probably just passing the _result_ of a function call to
> setTimeout rather than the function itself.
>
> In other words, if you are doing the following, you're almost
> certainly doing something wrong (or using some very obscure functional
> programming tricks):
>
> setTimeout(myFunc(), 1000); // WRONG
>
> This, on the contrary, works you're passing the function itself, not
> the _result_ of it):
>
> setTimeout(myFunc, 1000); // CORRECT
>
> Anyway, if you're doing ajax requests, you should NOT be using
> timeouts, but the provided callback system (as advised in a previous
> post).
>
And if, as you implied, that doesn't quite work because your callback
is building DOM and hasn't quite finished on some browsers by the time
you try to use the DOM, you should use Function.defer(), which is
designed for this purpose, rather than timeouts.
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---