Uncaught TypeError on Google reCAPTCHA

I download reCAPTCHA via JavaScript http://www.google.com/recaptcha/api/js/recaptcha_ajax.js and I use jquery-1.5.2.min.js to communicate with the local PHP script, which then checks the input via Google recaptchalib.php and returns JavaScript data in JSON format. This all works, but the Google Chrome Console reports an error:

Uncaught TypeError: Cannot set property 'innerHTML' of null  recaptcha_ajax.js:15
Recaptcha._init_builtin_theme                                recaptcha_ajax.js:15
Recaptcha._finish_widget                                     recaptcha_ajax.js:19
Recaptcha.challenge_callback                                 recaptcha_ajax.js:13
(anonymous function)                                                 challenge:12

I would like to resolve this error, but I do not know how to do it.

+5
source share
2 answers

, . , id - ?

+3

id , reCaptcha. id. reCpatcha, , id:

if($("#captcha").length) {
  Recaptcha.create("here_is_your_key", "captcha", {
    theme: "clean"
  });
}
+1

All Articles