错误消息我们检测到您的站点未验证reCAPTCHA解决方案。这是在您的站点上正确使用reCAPTCHA所必需的。我创建了这段reCaptcha代码,它工作得很好,但我不知道如何验证它,我以为它是用函数grecaptcha.getResponse();
验证的,但事实并非如此。显然,recaptcha在网站上运行良好,但我只是在谷歌管理中看到了下一条消息:
要求: javascript 1.不要在表单中使用,只能在表单中使用action="file.php"
函数。
<!DOCTYPE>
<html>
<head >
<title></title>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script type="text/javascript">
function get_action() {
var v = grecaptcha.getResponse();
console.log("Resp" + v );
if (v == '') {
document.getElementById('captcha').innerHTML = "You can't leave Captcha Code empty";
return false;
}
else {
document.getElementById('captcha').innerHTML = "Captcha completed";
return true;
}
}
</script>
</head>
<body>
<form id="form1" onsubmit="return get_action();">
<div>
<div class="g-recaptcha" data-sitekey="6LdNIlAUAAAAADS_uVMUayu5Z8C0tw_jspdntbYl"></div>
</div>
<input type="submit" value="Button" />
<div id="captcha"></div>
</form>
</body>
</html>
你能帮我吗?请。我将非常感谢我如何验证它,因为我在提交时需要使用javascript函数onsubmit="return get_action();"
而不是action="file.php"
*?:
https://stackoverflow.com/questions/49592772
复制相似问题