我有编程绑定方法,一旦我点击提交按钮,页面就永远不会显示加载的迹象。我只看到徽章无限重新加载,我的控制台显示重复加载相同的资源,一旦达到明显 reCAPTCHA 认为我是垃圾邮件机器人并让我解决验证码的地步,我解决它们并再次重复该过程,永无止境。
这是我在 reCAPTCHA 之前基于此答案 HTML5 表单验证的代码:
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
...
<form id='login' role='form' method='post'>
<div class="form-group">
<label for='form-user'>Username</label>
<input type='text' class='form-control' id='form-user' name='form-user' placeholder='Username' required>
</div>
<div class="form-group">
<label for='form-password'>Password</label>
<input type='password' class='form-control' id='form-password' name='form-password' placeholder='Password' required>
</div>
<div class='g-recaptcha' data-sitekey='my-key' data-size='invisible' data-callback='onSubmit'></div>
<input type='submit' value='Sign In' name='submit-btn' class='btn btn-default'>
</form>
<script>
$('#login').submit(function (event) {
event.preventDefault();
grecaptcha.reset();
grecaptcha.execute();
});
function onSubmit(response) {
$('#login').submit();
}
</script>
可能发生什么以及如何解决?我正在verify the origin of reCAPTCHA solutions
禁用本地主机。
提前致谢