bootstrap-ajax-typeahead
bootstrap-ajax-typeahead copied to clipboard
Overriding error handling
When ajax object is built need to add error function overriding for ajax call failure. (Example: 503 Service unavailable)
this.ajax.xhr = $.ajax({
url: this.ajax.url,
data: params,
success: $.proxy(this.ajaxSource, this),
//for example like that
error: this.ajax.error,
type: this.ajax.method || 'get',
dataType: 'json'
});