afc73e8dd4cb890df9d22ec3382a50978c2e467b
1 $(document
).ready(function() {
2 $('.submit').click(function() {
3 if ($('#comment_text').val() != '') {
4 var challenge
= Recaptcha
.get_challenge();
5 var response
= Recaptcha
.get_response();
6 var captcha_data
= { "challenge" : challenge
,
7 "response" : response
};
12 success: function(data
) {
13 if (data
.split('\n')[0] == 'true') {
14 var name
= $("#comment_name").val();
15 var email
= $("#comment_email").val();
16 var text
= $("#comment_text").val();
17 var comment_data
= { "captcha" : "passed",
23 // the url may need to be adjusted for
28 var new_post
= "<h3><a href='mailto:" + email
29 + "'>" + name
+ "</a></h3>"
31 $('#comments').prepend(new_post
);
33 console
.log('posted new comment');
37 console
.log('reCAPTCHA said you\'re not human.');
43 complete: function() {
48 console
.log('but you didn\'t write anything!');