diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 01:34:17 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 01:34:17 +0000 |
commit | fd49c7460705c4334efb0f943191c80540f3f629 (patch) | |
tree | 16b80e64aea61b2e15475acb5baa0e27afdf5560 /modules/tag/js | |
parent | 7a9d4a22249e55d0db298827565b8cbe4f031741 (diff) |
Convert tag module over to returning JSON.
Diffstat (limited to 'modules/tag/js')
-rw-r--r-- | modules/tag/js/tag.js | 13 |
1 files changed, 7 insertions, 6 deletions
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(); } }); } |