Reload reCaptcha after ajaxComplete

懵懂的女人 提交于 2019-12-08 15:55:36

问题


My reCaptcha is not reloading when ajaxComplete event complete.

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(); });

回答1:


Adding the grecaptcha.render('recaptchaId'); solved the problem.

So, the updated code is:

 $(document).ajaxComplete(function (event, request, settings) {
         grecaptcha.render('recaptchaWıdgetId'); });


来源:https://stackoverflow.com/questions/49927941/reload-recaptcha-after-ajaxcomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!