ReCAPTCHA 占位符元素必须是元素或 ID

编程入门 行业动态 更新时间:2024-10-28 20:26:18
本文介绍了ReCAPTCHA 占位符元素必须是元素或 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在使用 google recaptcha 时遇到了一些问题.

i have some problem with google recaptcha.

我在同一个网站上放了 2 个 recaptachs,但在不同的位置.

i put 2 recaptachs in same website but in deferent locations.

  • 我在页脚中放置:
  • <div class="g-recaptcha" id="recaptcha1"></div>

  • 我通过以下方式与我们联系:
  • <div class="g-recaptcha" id="recaptcha2"></div>

    但它给了我这个错误:ReCAPTCHA 占位符元素必须是元素或 ID.

    but its give me this error: ReCAPTCHA placeholder element must be an element or id.

    我的代码:

    <script src="www.google/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script> <script type="text/javascript"> var recaptcha1; var recaptcha2; var onloadCallback = function() { //Render the recaptcha1 on the element with ID "recaptcha1" recaptcha1 = grecaptcha.render('recaptcha1', { 'sitekey' : '*******', //Replace this with your Site key 'theme' : 'light' }); //Render the recaptcha2 on the element with ID "recaptcha2" recaptcha2 = grecaptcha.render('recaptcha2', { 'sitekey' : '*******', //Replace this with your Site key 'theme' : 'light' }); grecaptcha.reset(recaptcha1); grecaptcha.reset(recaptcha2); }; </script>

    我把之前的所有脚本和代码都放了

    i plase all the script and the code in the before

    我在这里进行了研究,但仍然无法正常工作.

    i did a reserach here but its still not working.

    感谢所有帮助.

    推荐答案

    仅在验证码标签之后附加您的脚本一次

    attach your script only once and after captcha tag

    更多推荐

    ReCAPTCHA 占位符元素必须是元素或 ID

    本文发布于:2023-10-26 10:19:58,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1529847.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:元素   ReCAPTCHA   ID

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!