From becd62fb957da0c16c4432c40cd818ea36e71828 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Thu, 10 Mar 2011 03:25:31 -0500 Subject: [PATCH] Now loads new comment after posting --- includes/ajax.js | 5 +++++ index.php | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/ajax.js b/includes/ajax.js index 50541dc..afc73e8 100644 --- a/includes/ajax.js +++ b/includes/ajax.js @@ -25,6 +25,11 @@ $(document).ready(function() { url: "verify", data: comment_data, success: function() { + var new_post = "

" + name + "

" + + text + "

"; + $('#comments').prepend(new_post); + $('#comment').hide(); console.log('posted new comment'); } }); diff --git a/index.php b/index.php index 8f8baae..ef5eddf 100644 --- a/index.php +++ b/index.php @@ -456,7 +456,6 @@ END_OF_COMMENT; $publickey = $this->recaptcha_publickey; echo << -function showRecaptcha() { Recaptcha.create("$publickey", "recaptcha_div", { @@ -464,16 +463,14 @@ Recaptcha.create("$publickey", custom_theme_widget: 'recaptcha_widget', callback: Recaptcha.focus_response_field }); -} END_CAPTCHA_STYLE; require_once('includes/recaptchalib.php'); // Trailing slash is necessary for reloads to work - $url = $this->url . "verify"; + $url = $this->url . "verify/"; echo "
"; - echo << -

comment?


@@ -493,6 +490,9 @@ END_CAPTCHA_STYLE;




+END_OF_FORM; + echo recaptcha_get_html($this->recaptcha_publickey); + echo << -- 2.30.2