大家好我需要一个问题,有一个叫做提交的按钮,我想当我点击按钮时,会出现reCAPTCHA表单,但现在,我必须点击三次才能显示reCAPTCHA表单。这是我的问题。谢谢你,从现在开始。 所有HTML代码:
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
function onSubmit(token) {
alert(token)
}
function onExpired() {
alert("onExpired")
}
function onError() {
alert("onError")
}
</script>
</head>
<body>
<form id='demo-form' action="?" method="POST">
<button id ="btnSubmit" class="g-recaptcha" data-sitekey="mysitekey here" data-callback='onSubmit' data-expired-callback='onExpired' error-callback='onError' >Submit</button>
<br/>
</form>
</body>
</html>