From: David ‘Bombe’ Roden Date: Sun, 8 May 2011 18:08:28 +0000 (+0200) Subject: Don’t post AJAX requests. X-Git-Tag: 0.6.4^2~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=83c775be91db2ac0b95afa4976a8c9bdfa611d31;p=Sone.git Don’t post AJAX requests. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index f872dae..9c082f1 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -17,23 +17,6 @@ function ajaxGet(url, data, successCallback, errorCallback) { })(url, data, successCallback, errorCallback); } -function ajaxPost(url, data, successCallback, errorCallback) { - (function(url, data, successCallback, errorCallback) { - $.ajax({"type": "POST", "url": url, "data": data, "dataType": "json", "success": function(data, textStatus, xmlHttpRequest) { - ajaxSuccess(); - if (typeof successCallback != "undefined") { - successCallback(data, textStatus); - } - }, "error": function(xmlHttpRequest, textStatus, errorThrown) { - if (typeof errorCallback != "undefined") { - errorCallback(); - } else { - ajaxError(); - } - }}); - })(url, data, successCallback, errorCallback); -} - function registerInputTextareaSwap(inputElement, defaultText, inputFieldName, optional, dontUseTextarea) { $(inputElement).each(function() { textarea = $(dontUseTextarea ? "" : "").blur(function() { @@ -880,7 +863,7 @@ function ajaxifyNotification(notification) { notification.find(".text").addClass("hidden"); } notification.find("form.mark-as-read button").click(function() { - ajaxPost("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": $(":input[name=type]", this.form).val(), "id": $(":input[name=id]", this.form).val()}); + ajaxGet("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": $(":input[name=type]", this.form).val(), "id": $(":input[name=id]", this.form).val()}); }); notification.find("a[class^='link-']").each(function() { linkElement = $(this);