Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google reCaptcha keeps loading forever

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.

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.

like image 431
sigmaxf Avatar asked Nov 06 '15 16:11

sigmaxf


People also ask

Why does CAPTCHA keep reloading?

Captcha 3 seems to require cookies to be on to work. Try turning cookies on if they are off and see if there is any difference. It only happens when there are lots of searches from the same ip address you are using at a time. In case you are getting this problem again and again you can restart your modem or router.

Why is CAPTCHA not loading?

Make sure your browser is fully updated (see minimum browser requirements) Check that JavaScript is enabled in your browser. Try disabling plugins that might conflict with reCAPTCHA.


2 Answers

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.

like image 84
sigmaxf Avatar answered Oct 22 '22 02:10

sigmaxf


your problem is:

<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-sitekey before use google captcha.

read more at https://developers.google.com/recaptcha/docs/display and https://www.google.com/recaptcha/admin#createsite

like image 24
Mr Jerry Avatar answered Oct 22 '22 01:10

Mr Jerry