},
_initSource: function() {
- var array,
+ var self = this,
+ array,
url;
if ( $.isArray(this.options.source) ) {
array = this.options.source;
} else if ( typeof this.options.source === "string" ) {
url = this.options.source;
this.source = function( request, response ) {
- $.getJSON( url, request, response );
+ self.xhr = $.getJSON( url, request, function( data, status, xhr ) {
+ if ( xhr === self.xhr ) {
+ response.apply( this, arguments );
+ }
+ });
};
} else {
this.source = this.options.source;