If ajaxStop is called before the setTimeout callback in ajaxStart is run,
active will be false, so the addClass() on line 9 won't get executed.
Without this, if ajaxStop ran before the setTimeout callback, the
removeClass() would happen before the addClass(), so the class would never
get removed.

--Erik


On 9/2/07, barophobia <[EMAIL PROTECTED]> wrote:
>
>
> On 9/1/07, Michael Geary <[EMAIL PROTECTED]> wrote:
> >
> > Also, it looks like you have a race condition. What happens if the
> entire
> > AJAX request completes in less than 100 milliseconds?
>
> I assumed that $.ajaxStart() would be canceled and $.ajaxStop() would
> execute.
>
> I looked over your code but I don't see how the flag (called active)
> changes anything. Would you explain?
>
>
> Thanks,
> Chris.
>

Reply via email to