如何使用JavaScript重新加载ReCaptcha? [英] How to Reload ReCaptcha using JavaScript?
本文介绍了如何使用JavaScript重新加载ReCaptcha?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用AJAX的注册表单,因此我想在发生错误时刷新Recaptcha图像(即用户名已在使用中)。
I have a signup form with AJAX so that I want to refresh Recaptcha image anytime an error is occured (i.e. username already in use).
我在寻找与ReCaptcha兼容的代码,使用JavaScript重新加载它。
I am looking for a code compatible with ReCaptcha to reload it using JavaScript.
推荐答案
重要提示:不再支持reCAPTCHA API 1.0版,请升级到2.0版。
Important: Version 1.0 of the reCAPTCHA API is no longer supported, please upgrade to Version 2.0.
您可以使用 grecaptcha.reset(); 重置验证码。
You can use grecaptcha.reset(); to reset the captcha.
来源: https: //developers.google.com/recaptcha/docs/verify#api-request
这篇关于如何使用JavaScript重新加载ReCaptcha?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文