summaryrefslogtreecommitdiff
path: root/misc/ahah.js
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ahah.js')
-rw-r--r--misc/ahah.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/ahah.js b/misc/ahah.js
index acbd4812f..775159d6b 100644
--- a/misc/ahah.js
+++ b/misc/ahah.js
@@ -85,8 +85,8 @@ Drupal.ahah = function(base, element_settings) {
return ahah.success(response, status);
},
complete: function(response, status) {
- if (status == 'error') {
- return ahah.error(response.responseText);
+ if (status == 'error' || status == 'parsererror') {
+ return ahah.error(response, ahah.url);
}
},
dataType: 'json',
@@ -194,10 +194,10 @@ Drupal.ahah.prototype.success = function (response, status) {
/**
* Handler for the form redirection error.
*/
-Drupal.ahah.prototype.error = function (error) {
- alert(Drupal.t('An error occurred:\n\n@error', { '@error': error }));
+Drupal.ahah.prototype.error = function (response, uri) {
+ alert(Drupal.ahahError(response, uri));
// Resore the previous action and target to the form.
- element.parent('form').attr( { action: this.form_action, target: this.form_target} );
+ $(this.element).parent('form').attr( { action: this.form_action, target: this.form_target} );
// Remove the progress element.
if (this.progress.element) {
$(this.progress.element).remove();