From fd49c7460705c4334efb0f943191c80540f3f629 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 01:34:17 +0000 Subject: Convert tag module over to returning JSON. --- modules/tag/js/tag.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'modules/tag/js') diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 74e48998..92f585a5 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -3,16 +3,17 @@ $("document").ready(function() { }); function ajaxify_tag_form() { - $("#gAddTagForm").ajaxForm({ - complete: function(xhr, statusText) { - $("#gAddTagForm").replaceWith(xhr.responseText); - if (xhr.status == 201) { + $("#gTag form").ajaxForm({ + dataType: "json", + success: function(data) { + $("#gTag form").replaceWith(data.form); + ajaxify_tag_form(); + if (data.result == "success") { $.get($("#gTagCloud").attr("src"), function(data, textStatus) { $("#gTagCloud").html(data); }); - $("#gAddTagForm").clearForm(); } - ajaxify_tag_form(); + $("#gTag form").clearForm(); } }); } -- cgit v1.2.3