Commit ee20236b authored by fred's avatar fred
Browse files

also load contents of error pages over ajax

parent bc0f8e6a
......@@ -57,6 +57,10 @@ $(function() {
init();
};
function afterLoadError(xhr, text, error) {
afterLoad(xhr.responseText, 'error', xhr);
};
$(window).on("popstate", function(e) {
if (e.originalEvent.state !== null) {loadPage(location.href);}
});
......@@ -66,7 +70,11 @@ $(function() {
if (loadPage_request !== null) {
loadPage_request.abort();
}
loadPage_request = $.get(href, null, afterLoad);
loadPage_request = $.ajax({
url: href,
success: afterLoad,
error: afterLoadError,
dataType: 'html'});
};
$.fn.ajaxifyClick = function(params) {
this.each(function() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment