jquery ajax abort -


I am working on an autocomplete search option and for this I use the jquery abort function Because I need to cancel the previous call and there is a call code starting at every keypace

  if (ajaxCall) ajaxCall.abort (); AJAX call = $ .ajax ({url: '& lt ;? php echo base_ url () ;? & gt; welcome /' + target, before: function () {}, complete: function () {}, data : Data, type: 'post', success: work (results) {....}});   

However its work is fine, but are concerned about its use if it is okay to use this method or not because I can see many canceled calls in the firebug console? I think the canceled call has not really been aborted from the server, but am I right from the browser itself?

Is there any other option for this approach or is it OK to use it?

When you call abort () , turn off the HTTP connection will be given. Whether or not it stops your PHP script (it seems that you are using the codeigner) depends on your server setup, but default is, yes.

Whether the server completes the request or not, the result will be sent to the client never , so the result will not be displayed .

However, I ask why you are canceling each request if I was doing auto-complete coding, before sending the request, the duration of inactivity (like user To stop typing), allows or to complete and show requests; Some results (even if they are 1 character) are no better than a result, okay?

Comments