【发布时间】:2015-09-29 10:20:00
【问题描述】:
我在一个页面上有两个表单,它们都使用 Google reCAPTCHA。
每当我使用grecaptcha.reset(); 时,它只会重置第一个实例。
以下 JS 呈现 reCAPTCHA(s)
var recaptcha1;
var recaptcha2;
var myCallBack = function() {
//Render the recaptcha1 on the element with ID "recaptcha1"
recaptcha1 = grecaptcha.render('recaptcha1', {
'sitekey' : '1234', //Replace this with your Site key
'theme' : 'light'
});
//Render the recaptcha2 on the element with ID "recaptcha2"
recaptcha2 = grecaptcha.render('recaptcha2', {
'sitekey' : '1234', //Replace this with your Site key
'theme' : 'light'
});
};
如何重置所有实例或定位特定实例。
【问题讨论】:
标签: javascript jquery recaptcha