Errors display on ajax requests.

fixed #138
This commit is contained in:
Antoine Nguyen
2011-05-18 14:18:41 +02:00
parent d421ac88a9
commit f0fe73e8b0
+15 -7
View File
@@ -58,13 +58,21 @@ function check_anchor() {
profile: current_anchor.loading_color,
spinner: true
});
new Request.JSON({url: query, noCache : true, onSuccess: function(resp) {
var callback = ($defined(resp.callback)) ? resp.callback : "default";
callbacks[callback](resp);
infobox.info(gettext("Done"));
infobox.hide(1);
current_anchor.reset_loading_infos();
}}).get();
new Request.JSON({
url: query,
noCache : true,
onSuccess: function(resp) {
var callback = ($defined(resp.callback)) ? resp.callback : "default";
callbacks[callback](resp);
infobox.info(gettext("Done"));
infobox.hide(1);
current_anchor.reset_loading_infos();
},
onFailure: function(xhr) {
$(document.body).set("html", xhr.responseText);
$(document.body).setStyle("overflow", "auto");
}
}).get();
};
/*