我有一个不可见的reCAPTCHA,可以在加载时工作,但是,我不明白如何实现g-recaptcha-response。谁能帮我吗?用户提交reCAPTCHA时,我需要一个POST参数。
<head>
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<script>
function onSubmit(){
console.log("Submitted");
}
function loadCaptcha(){
console.log("loaded");
setTimeout(function(){grecaptcha.execute()},2000)
}
</script>
</head>
<body onload="grecaptcha.execute();console.log('LOADED')">
<div class="g-recaptcha"
data-sitekey="xxxxxxxxxxxxxxxxxxxxxxxxx"
data-callback="onSubmit"
data-size="invisible">
</div>
</body>