我只是在提交表单后尝试让Google Invisible ReCaptcha工作.我的问题是,ReCaptcha不是看不见的,看起来像是"旧的"重新出现了.我不明白为什么.我的网站密钥是无形的recaptcha.请帮我.
首先,我正在加载API:
<script src='https://www.google.com/recaptcha/api.js?render=explicit&onload=onScriptLoad' async defer></script>
Run Code Online (Sandbox Code Playgroud)
我的表单看起来像这样:
<form method="post" id="contact-form-face" class="clearfix" onsubmit="return false">
<input type="text" required name="name" value="name" onFocus="if (this.value == 'name') this.value = '';" onBlur="if (this.value == '') this.value = 'name';" />
<button type="submit" id="sendButton" data-size="invisible" class="g-recaptcha contact_btn" onclick="onSubmitBtnClick()" value="send" >send</button>
</form>
Run Code Online (Sandbox Code Playgroud)
JS:
window.onScriptLoad = function () {
// this callback will be called by recapcha/api.js once its loaded. If we used
// render=explicit as param in script src, then we can explicitly render reCaptcha at this …Run Code Online (Sandbox Code Playgroud)