From: Dylan Lloyd Date: Thu, 10 Mar 2011 08:25:31 +0000 (-0500) Subject: Now loads new comment after posting X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=becd62fb957da0c16c4432c40cd818ea36e71828;p=dylansserver.git Now loads new comment after posting --- 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 <<