[jQuery] Re: Killing ajax calls

2007-08-22 Thread Tamm Sjödin
well, that'd make sense when used together with the rest I have, but that wouldn't prevent users from being stupid enough to type so slow it'd trigger multiples anyhow, would it? also, I actually had a delay before and it didn't work... maybe I should add it again just for the sake of doing this th

[jQuery] Re: Killing ajax calls

2007-08-22 Thread Matt Stith
A much better solution is to set a delay on the keyup, say, half a second, then execute the ajax request when that timeout finishes. Its much easier on your server to do it this way. On 8/22/07, Tamm Sjödin <[EMAIL PROTECTED]> wrote: > > actually that made things even more confusing :P > > for the

[jQuery] Re: Killing ajax calls

2007-08-22 Thread Tamm Sjödin
actually that made things even more confusing :P for the record, I've found a solution to my problem, it doesn't do what I first wanted but it works really well. basically I used the var xhr=$ajax; solution and added: $("#thing").keypress(function(){xhr.abort();}); this aborts all previous reque

[jQuery] Re: Killing ajax calls

2007-08-22 Thread lordb
You can easily prevent execution of ajax request with a flag. When you make an Ajax call the flag is set to 1 (if its allready to 1 you don't launch request) In the callback you just turn back the flag to 0 and you can perform a quick test to for comparing the last search made width the actual s

[jQuery] Re: Killing ajax calls

2007-08-22 Thread Tamm Sjödin
It's a search function that I trigger on key up. It doesn't work bad it's just a risk of previous requests finishing after the last one, meaning the content of the result box being replaced again but by the wrong stuff. Stopping all ajax calls was just one of my solutions, one that seemed easy to i

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Pops
On Aug 21, 9:07 pm, "Mike Fern" <[EMAIL PROTECTED]> wrote: > > yep, it's a plugin called ajax queue > this is the > url:http://groups.google.com/group/jquery-en/browse_thread/thread/fde5bcf... > Thanks Mike. This should come in useful! :-) -- HLS

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Mike Fern
>On 8/22/07, Stephan Beal <[EMAIL PROTECTED]> wrote: > > John Resig made a post about a week (maybe two?) ago with some > prototype code implementing serial ajax queues. If i'm not mistaken, > that code should provide a way to kill the queue, or at least stop any > requests which haven't already g

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Pops
On Aug 21, 8:28 pm, Stephan Beal <[EMAIL PROTECTED]> wrote: > John Resig made a post about a week (maybe two?) ago with some > prototype code implementing serial ajax queues. If i'm not mistaken, > that code should provide a way to kill the queue, or at least stop any > requests which haven't alr

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Eridius
What are you trying to do? Once you send a AJAX request you can not cancel it(to the best of my knowledge) and if you try to send another while that one it still processing, than that one will fail. Tamm wrote: > > > I'm working on a function that sends far too many ajax calls, an easy > way

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Stephan Beal
On Aug 22, 1:05 am, Tamm <[EMAIL PROTECTED]> wrote: > I'm working on a function that sends far too many ajax calls, an easy > way to take care of the problem would be to kill all ajax calls before > sending a new one (i.e. if it isn't done yet, nvm the result) > > the xhr object idea works for one

[jQuery] Re: Killing ajax calls

2007-08-21 Thread Matt Stith
Can we get a description of what you are doing? There shouldnt be a reason for a function to send tons of ajax calls. Either condense them to 1, or use a different method. On 8/21/07, Tamm <[EMAIL PROTECTED]> wrote: > > > I'm working on a function that sends far too many ajax calls, an easy > way