我加入谷歌的v2的的Recaptcha有问题像这样一个骨干视图:删除的Recaptcha v2的有问题正在得到解决后
// this is the callback function
var getRecaptchaResponse = function (response) {
if (response) {
thisView.captchaResponse = response;
thisView.canShowContinue();
} else {
alert("Captcha response was incorrect");
}
};
// render the recaptcha
var renderCaptcha = function() {
thisView.captchaWidgetId = grecaptcha.render('recaptcha-container', {
sitekey: GlobalSettings.recaptchaKey,
callback: getRecaptchaResponse,
size: 'compact'
});
};
// map the internal function to the window
// so that the callback registered in the
// link below can be called by JSONP.
window.renderCaptcha = renderCaptcha;
// load the script
$.getScript('https://www.google.com/recaptcha/api.js?onload=renderCaptcha&render=explicit', function() { });
一旦Captcha验证码被成功地解决了我想从用户界面中删除它,所以我“M简单地移除div
容器:
// if the user has solved the captcha yet, don't continue
if (!thisView.captchaResponse) {
return;
}
// remove recpatcha
$('#recaptcha-container').remove();
似乎没有要,谷歌已经提供给摧毁grecaptcha
部件虽然一个正确API method。这是一个问题吗?推荐的方法是什么?
以上移除的容器在Chrome中运行,但不在IE11中运行。在IE11中,验证码挑战仍然可见。
您的意思是编程验证码对象? – Ezenhis
@Ezenhis正好。我正在寻找'grecaptcha.remove('recaptcha-container');'或者其他类似的东西。 – Junto