50541dc89aa70b782593de2d6759e876da2eeb06
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 console
.log('posted new comment');
32 console
.log('reCAPTCHA said you\'re not human.');
38 complete: function() {
43 console
.log('but you didn\'t write anything!');