1 var currentRequest = null;
2
3currentRequest = jQuery.ajax({
4 type: 'POST',
5 data: 'value=' + text,
6 url: 'AJAX_URL',
7 beforeSend : function() {
8 if(currentRequest != null) {
9 currentRequest.abort();
10 }
11 },
12 success: function(data) {
13 // Success
14 },
15 error:function(e){
16 // Error
17 }
18});