我加入谷歌的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