How to completely DESTROY the new reCAPTCHA?

7,251 views
Skip to first unread message

Ivan Lovrić

unread,
Dec 24, 2014, 10:50:01 AM12/24/14
to reca...@googlegroups.com
I need to completely destroy the reCAPTCHA element, but it has no destroy() method... Is there a manual way to do it?
I need to do it because the page with the reCAPTCHA is loaded with Javascript, but it only works the first time, other times the page loads I get javascript errors (Blocked a frame with origin "https://www.google.com" from accessing a frame with origin...)

Ivan Lovrić

unread,
Jan 5, 2015, 3:56:36 AM1/5/15
to reca...@googlegroups.com
There is no simple way to do it, right? If there is no easy way to destroy it using a destroy() method, did anyone manage to remove it manually?

Stefan

unread,
Jan 6, 2015, 1:44:34 AM1/6/15
to reca...@googlegroups.com
You have to use jQuery, especially if you use multiple forms. Than you can fire this code if you show the form.

try{
        grecaptcha
.reset()
}
catch(e){
       
null
}


grecaptcha.render('RecaptchaID', {
       
'sitekey' : 'YOUR_sitekey'
   
});

Everytime this script is fired, recaptcha will be reseted and a new one will be shown.
This is the Div for Recaptcha:

<div id="RecaptchaID"></div>

And place this at the End before </body>.

Reply all
Reply to author
Forward
0 new messages