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