diff --git a/select2.js b/select2.js index 9ece8c36..b85ad806 100755 --- a/select2.js +++ b/select2.js @@ -212,6 +212,7 @@ function ajax(options) { var timeout, // current scheduled but not yet executed request requestSequence = 0, // sequence used to drop out-of-order responses + handler = null, quietMillis = options.quietMillis || 100; return function (query) { @@ -224,7 +225,10 @@ data = data.call(this, query.term, query.page); - transport.call(null, { + if( null !== handler){ + handler.abort(); + } + handler = transport.call(null, { url: options.url, dataType: options.dataType, data: data,