diff --git a/misc/ajax.js b/misc/ajax.js index bb4a6e1..c4401f1 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -476,7 +476,14 @@ Drupal.ajax.prototype.getEffect = function (response) { * Handler for the form redirection error. */ Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { - alert(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) { $(this.progress.element).remove(); diff --git a/misc/autocomplete.js b/misc/autocomplete.js index d71441b..c866d29 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -310,7 +310,15 @@ Drupal.ACDB.prototype.search = function (searchString) { } }, error: function (xmlhttp) { - alert(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);