My reCaptcha is not reloading when ajaxComplete event plete.
I have a console error: "No reCAPTCHA clients exist." So why my reCaptcha client disappeared after ajaxComplete?
Here is my sample code:
$(document).ajaxComplete(function (event, request, settings) {
grecaptcha.reset(); });
My reCaptcha is not reloading when ajaxComplete event plete.
I have a console error: "No reCAPTCHA clients exist." So why my reCaptcha client disappeared after ajaxComplete?
Here is my sample code:
$(document).ajaxComplete(function (event, request, settings) {
grecaptcha.reset(); });
Share
Improve this question
edited Mar 10, 2019 at 22:35
Cody Gray♦
245k53 gold badges504 silver badges584 bronze badges
asked Apr 19, 2018 at 18:33
user4095424user4095424
2 Answers
Reset to default 2Adding the grecaptcha.render('recaptchaId');
solved the problem.
So, the updated code is:
$(document).ajaxComplete(function (event, request, settings) {
grecaptcha.render('recaptchaWıdgetId'); });
The problem is clearly stated in the exception. You need to render reCaptcha on the page with grecaptcha.render
:
var domId = 'recaptchaId';
grecaptcha.render(domId, {"sitekey": "YOUR_CAPTCHA_ID", size: 'invisible'});
In my case error came from minified code:
if (y[6](57).contains(window.___grecaptcha_cfg.clients[P].Ci)){
Y=P;
break a
}
throw Error("No reCAPTCHA clients exist.");
and window.___grecaptcha_cfg.clients
was empty till I fixed the order: render
is called before execute
.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742299593a4417787.html
评论列表(0条)