From de751ed623f10b99d583aeb8c1a705e0e231eb90 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 30 Jan 2014 09:31:53 -0500 Subject: [PATCH] fixed #900 - api calls hopefully no longer cached --- public/src/templates.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/public/src/templates.js b/public/src/templates.js index 993cf20f30..97c1c63b06 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -186,23 +186,27 @@ parse_template(); } - apiXHR = jQuery.get(RELATIVE_PATH + '/api/' + api_url, function (data) { - - if (!data) { - ajaxify.go('404'); - return; - } + apiXHR = $.ajax({ + url: RELATIVE_PATH + '/api/' + api_url, + cache: false, + success: function (data) { + if (!data) { + ajaxify.go('404'); + return; + } - template_data = data; - parse_template(); - }).fail(function (data, textStatus) { - jQuery('#content, #footer').stop(true, true).removeClass('ajaxifying'); - if (data && data.status == 404) { - return ajaxify.go('404'); - } else if (data && data.status === 403) { - return ajaxify.go('403'); - } else if (textStatus !== "abort") { - app.alertError(data.responseJSON.error); + template_data = data; + parse_template(); + }, + error: function (data, textStatus) { + $('#content, #footer').stop(true, true).removeClass('ajaxifying'); + if (data && data.status == 404) { + return ajaxify.go('404'); + } else if (data && data.status === 403) { + return ajaxify.go('403'); + } else if (textStatus !== "abort") { + app.alertError(data.responseJSON.error); + } } });