Google ReCAPTCHA callback function not working

I use Google reCAPTCHA on my website and I am having trouble calling the callback function. After the user successfully passed captcha, I want to call the function. I use a div with these attributes to display captcha:

class='g-recaptcha' data-sitekey='keyhere' data-callback='alert(1);'

However, I can’t get it to alert(1);start, nothing happens when I fill in the captcha. Everything else about captcha works fine, I just can't get it to call a function. What can i do wrong?

+4
source share
1 answer

, , , , , , , data-callback , script :

class='g-recaptcha' data-callback='doSomething'

function doSomething() { alert(1); }
+10

All Articles