From ce7fbf979d249e5e1effb7040d3e51a2c35015e3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Nov 2008 07:27:36 +0000 Subject: Stop using the target param; replace the form by hand so that we can run ajaxify_comment_form() as needed. Otherwise the 2nd post attempt won't be ajax --- themes/default/js/comment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'themes/default/js/comment.js') diff --git a/themes/default/js/comment.js b/themes/default/js/comment.js index 5d2ed599..5cb236e8 100644 --- a/themes/default/js/comment.js +++ b/themes/default/js/comment.js @@ -4,9 +4,8 @@ $("document").ready(function() { function ajaxify_comment_form() { $("#gCommentForm").ajaxForm({ - target: "#gCommentForm", complete: function(xhr, statusText) { - ajaxify_comment_form(); + $("#gCommentForm").replaceWith(xhr.responseText); if (xhr.status == 201) { $.get(xhr.getResponseHeader("Location"), function(data, textStatus) { $("#gComment div.gBlockContent ul:first").append(data); @@ -15,6 +14,7 @@ function ajaxify_comment_form() { ); $("#gCommentForm").clearForm(); } + ajaxify_comment_form(); } }); } -- cgit v1.2.3