Hel*_*rld 7 html javascript recaptcha
我在我的网站上的 Google Recaptcha V3 中收到以下错误。
网站所有者错误:密钥类型无效
我使用以下方法来验证验证码:
<script src="https://www.google.com/recaptcha/api.js?render=API_KEY"></script>
Run Code Online (Sandbox Code Playgroud)
$('.submit-e-way-bill-registration').on('submit', function (e) {
e.preventDefault();
var self = this;
if ($(self)[0].checkValidity()) {
grecaptcha.ready(function () {
grecaptcha.execute('API_KEY', {
action: 'homepage'
}).then(function (token) {
console.log(token);
console.log('google captcha initiated');
$('[name=captcha_token]').val(token);
var data = $(self).serialize();
$('.save-button-ewb').prop('disabled', true);
$.post('/api/submit-e-way-bill-registration.php', data, function (result) {
$('.save-button-ewb').prop('disabled', false);
console.log('status');
if (result.status == 'success') {
$('.success-message').show();
$('.submit-e-way-bill-registration').hide();
} else {
$('.error-message').show();
$('.submit-e-way-bill-registration').hide();
}
});
});
});
}
});
Run Code Online (Sandbox Code Playgroud)
以前(大约 3-4 个月前)曾经这样工作过。现在,当我检查时,出现上述错误。
谁能告诉我代码有什么问题吗???