验证码以嵌入式方式展示如何配置?
修改于 2023-08-31 14:35:51
216- 初始化验证码对象时,将 options 提供的配置参数 type 设置为
embed 。new TencentCaptcha(element, CaptchaAppId, callback, {type: 'embed'}); - 示例代码<div id="tc"></div>
<script>
//初始化验证码对象,将验证码绑定到id为‘tc’的容器元素中
new TencentCaptcha(document.getElementById('tc'),CaptchaAppId,callback,{type:'embed'}).show()
</script>!如果使用嵌入式,容器元素在界面里找不到会报错。