Invisible ReCaptcha V2 - grecaptcha.reset() returns SyntaxError: JSON.parse: unexpected character at line 1

614 views
Skip to first unread message

Kevin Mamaqi

unread,
Aug 27, 2019, 2:56:46 PM8/27/19
to reCAPTCHA
Hi,

I am using jQuery AJAX + PHP for a reset password form on my website. Each time there is an error I include the following code:

if (data.response == "wrong_data") {
    generateToast
(data.message, 7000);
    grecaptcha
.reset();
}

But the response from https://www.google.com/recaptcha/api2/reload?k= is always:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data


)]}'
["rresp", .......

As a result, if the user introduces a wrong email has to reload the page to submit it again as recaptcha won reset.


What is the error?
Reply all
Reply to author
Forward
0 new messages