如何在我的网站中隐藏Google reCAPTCHA v3?

时间:2018-11-01 21:24:55

标签: recaptcha recaptcha-v3

我刚刚从v2升级,而css不再是从我的UI中隐藏recaptcha徽章的有效选项。可以用JavaScript完成吗?

2 个答案:

答案 0 :(得分:3)

您可以通过递归和requestAnimationFrame来实现。

尝试创建类似这样的内容:

function hideRecaptcha() {
    const recaptcha = $(".grecaptcha-badge");
    if (recaptcha.length) return recaptcha.css({ display: "none" });
    requestAnimationFrame(() => this.hideRecaptcha());
}

然后在加载Recaptcha脚本后立即调用hideRecaptcha()

答案 1 :(得分:0)

您应该将其设置为可见性:无,因为如果您使用无显示并完全删除它,它可能会中断垃圾邮件检查。

请看这里。 How to hide the Google Invisible reCAPTCHA badge

相关问题