From: John Firebaugh Date: Wed, 13 Nov 2013 19:59:52 +0000 (-0800) Subject: Show XHR responseText on error X-Git-Tag: live~5173^2~89 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b8a449b4b124f97e226e584ca21c55b157bfabc8 Show XHR responseText on error --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index f6cb02230..5724eaae8 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -33,17 +33,22 @@ } $('#sidebar_content') - .empty() - .load(path, function(a, b, xhr) { + .empty(); + + $.ajax({ + url: path, + complete: function(xhr) { clearTimeout(loaderTimeout); $('#sidebar_loader').hide(); + $('#sidebar_content').html(xhr.responseText); if (xhr.getResponseHeader('X-Page-Title')) { document.title = xhr.getResponseHeader('X-Page-Title'); } if (callback) { callback(); } - }); + } + }); }; })();