gpt4 book ai didi

javascript - ReCAPTCHA ajax加载主题问题

转载 作者:可可西里 更新时间:2023-11-01 02:39:54 26 4
gpt4 key购买 nike

无法弄清楚如何为 ajax 加载的 recaptcha 设置主题。下面的代码不起作用。
来自 Google Recaptcha

看到这篇文章 Recaptcha ajax API custom theme not working , 但我肯定是在本地主机上查看并且 recaptcha 工作正常,只是没有改变主题。

有人对如何使用白色主题有建议吗?

    <script type='text/javascript'>
var RecaptchaOptions = {
theme : 'white'
};
</script>
<div id="recaptcha_content">
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=6Ldr7woAAAAAADa_69Mr-EZKAeYyEx9N08q" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
</noscript>
</div>
<script type="text/javascript">
$(document).ready(function() {
$.getScript('http://www.google.com/recaptcha/api/js/recaptcha_ajax.js',
function() {Recaptcha.create("6Ldr7woAAAAAADa_69Mr-EZKAeYyEx9N08q", "recaptcha_content");
});

});
</script>

最佳答案

@jhanifen:在使用 http://wiki.recaptcha.net/index.php/Installation 中的大部分代码后,我开始工作了,试试这个——

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
</head>

<body>

<script type="text/javascript">
$(document).ready(function() {
$.getScript('http://www.google.com/recaptcha/api/js/recaptcha_ajax.js',
function() {
Recaptcha.create("6Ldr7woAAAAAADa_69Mr-EZKAeYyEx9N08q",
"recaptcha_content",
{
theme: "white",
callback: Recaptcha.focus_response_field
}
);
});
});
</script>

<div id="recaptcha_content">
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=6Ldr7woAAAAAADa_69Mr-EZKAeYyEx9N08q" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type='hidden' name='recaptcha_response_field' value='manual_challenge' />
</noscript>
</div>

</body>
</html>

关于javascript - ReCAPTCHA ajax加载主题问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5279069/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com