diff --git a/misc/ajax.js b/misc/ajax.js
index bb4a6e1..b77e639 100644
--- a/misc/ajax.js
+++ b/misc/ajax.js
@@ -476,7 +476,12 @@ 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(response.status) {
+    alert(Drupal.ajaxError(response, uri));
+  }
+  else if (window.console) {
+    console.log(Drupal.ajaxError(response, uri));
+  }
   // Remove the progress element.
   if (this.progress.element) {
     $(this.progress.element).remove();
diff --git a/misc/autocomplete.js b/misc/autocomplete.js
index d71441b..7a92c33 100644
--- a/misc/autocomplete.js
+++ b/misc/autocomplete.js
@@ -310,7 +310,12 @@ Drupal.ACDB.prototype.search = function (searchString) {
         }
       },
       error: function (xmlhttp) {
-        alert(Drupal.ajaxError(xmlhttp, db.uri));
+        if (xmlhttp.status) {
+          alert(Drupal.ajaxError(xmlhttp, db.uri));
+        }
+        else if (window.console) {
+          console.log(Drupal.ajaxError(xmlhttp, db.uri));
+        }
       }
     });
   }, this.delay);
