The traditional way of using "I am not a robot" Recpatcha seems to be with a <form>
on client-side:
<form action="post.php" method="POST">
<div class="g-recaptcha" data-sitekey="6Lc_0f4SAAAAAF9ZA_d7Dxi9qRbPMMNW-tLSvhe6"></div>
<button type="submit">Sign in</button>
</form>
<script src='https://www.google.com/recaptcha/api.js'></script>
Then some g-recaptcha-response
will be sent to server.
However, in my code I don't use a <form>
but an AJAX call instead:
$('#btn-post').click(function(e) {
$.ajax({
type: "POST",
url: "post.php",
data: {
action: 'post',
text: $("#text").val(),
ajaxMode: "true"
},
success: function(data) { },
error: function(data) { }
}); } });
How to get the g-recaptcha-response
answer with this solution?