javascript Google reCaptcha 永远加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33571032/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Google reCaptcha keeps loading forever
提问by raphadko
I'm using Google's reCaptcha 2.0 on my website. It used to work well, but since I opened my website to the public and got some more users, recaptcha is not working anymore with most users.. it loads fine, but once the user clicks the "I'm not a robot" checkbox, it keeps loading eternally and never returns a confirmation.
我在我的网站上使用 Google 的 reCaptcha 2.0。它曾经运行良好,但由于我向公众开放了我的网站并获得了更多用户,recaptcha 不再适用于大多数用户。它加载良好,但是一旦用户单击“我不是机器人”复选框,它会一直加载并且永远不会返回确认。
I tried to look all over the web for it, but couldn't find someone with a similar issue, and I have no idea how to (or if I can) debug it, since apparently it's not returning a response from google. All my keys are correct.
我试图在整个网络上寻找它,但找不到有类似问题的人,而且我不知道如何(或者我是否可以)调试它,因为显然它没有从谷歌返回响应。我所有的钥匙都是正确的。
Can someone help me out? My website is www.heropanel.com- to simulate it, click on contact at the bottom of the page, and click the "I'm not a robot" checkbox.
有人可以帮我吗?我的网站是www.heropanel.com- 要模拟它,请单击页面底部的联系人,然后单击“我不是机器人”复选框。
采纳答案by raphadko
Actually I found the answer. The captcha was loading inside a modal popup div. When this popup loaded, it would change the div's parent and that somehow broke the captcha (probably some embedded security code). My solution was to reload the captcha after the window popup.
其实我找到了答案。验证码正在加载到模态弹出 div 中。当这个弹出窗口加载时,它会改变 div 的父级,并以某种方式破坏了验证码(可能是一些嵌入式安全代码)。我的解决方案是在弹出窗口后重新加载验证码。
回答by Mr Jerry
your problem is:
你的问题是:
<div class="g-recaptcha" data-theme="light"></div>
<div class="g-recaptcha" data-theme="light"></div>
you are missing attribute. the correct will be:
你缺少属性。正确的将是:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="your_google_public_key"></div>
You hav create data-sitekeybefore use google captcha.
在使用谷歌验证码之前,您已经创建了数据站点密钥。
read more at https://developers.google.com/recaptcha/docs/displayand https://www.google.com/recaptcha/admin#createsite
在https://developers.google.com/recaptcha/docs/display和https://www.google.com/recaptcha/admin#createsite阅读更多
回答by Husnain Shabbir
I have same problem. When i click on reCaptcha its just loading and not give the response. Mostly solutions that i found were to reload reCaptcha, but it could not solve my problem.Finally I found that I use bool type variable 'length=false' that cause to create that problem. I jsut change the variable name and solve my problem.
我有同样的问题。当我点击 reCaptcha 时,它只是加载而不给出响应。我发现的大多数解决方案是重新加载 reCaptcha,但它无法解决我的问题。最后我发现我使用了导致创建该问题的 bool 类型变量“length=false”。我只是更改变量名称并解决我的问题。
Reload or reset reCaptcha by using 'grecaptcha.reset();'.
Make sure not use any reserve word(as i mention above) in your script.
使用“grecaptcha.reset();”重新加载或重置 reCaptcha。
确保不要在脚本中使用任何保留字(如我上面提到的)。
回答by Doron Massa
I was able to resolve the issue after I switched to SSL Although everything worked fine on desktop even under http . Mobile Android reCaptcha continued to spinning without approval
切换到 SSL 后,我能够解决该问题,尽管在桌面上一切正常,即使在 http 下。移动 Android reCaptcha 未经批准继续旋转