diff -u b/misc/ajax.js b/misc/ajax.js --- b/misc/ajax.js +++ b/misc/ajax.js @@ -476,11 +476,13 @@ * Handler for the form redirection error. */ Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { - if (xmlhttprequest.status) { - alert(Drupal.ajaxError(xmlhttprequest, uri, customMessage)); - } - else if (window.console) { - console.log(Drupal.ajaxError(xmlhttprequest, uri, customMessage)); + if (xmlhttprequest.status >= 400) { + if (window.console) { + console.log(Drupal.ajaxError(xmlhttprequest, uri, customMessage)); + } + else { + alert(Drupal.ajaxError(xmlhttprequest, uri, customMessage)); + } } // Remove the progress element. if (this.progress.element) { diff -u b/misc/autocomplete.js b/misc/autocomplete.js --- b/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -310,12 +310,15 @@ } }, error: function (xmlhttp) { - if (xmlhttp.status) { - alert(Drupal.ajaxError(xmlhttp, db.uri)); - } - else if (window.console) { - console.log(Drupal.ajaxError(xmlhttp, db.uri)); + if (xmlhttp.status >= 400) { + if (window.console) { + console.log(Drupal.ajaxError(xmlhttp, db.uri)); + } + else { + alert(Drupal.ajaxError(xmlhttp, db.uri)); + } } + } }); }, this.delay);