简体   繁体   English

Google Captcha自动加载

[英]Google Captcha AutoLoad

i have issue regarding google captcha auto load . 我有关于Google验证码自动加载的问题。 google captcha give me source according onclick function but im weak in javascript can't modify in autoload function anyone guide me how can i change autoload function when page load captcha auto show.important thing is that im using fancybox ajax optn that why have some complications .code mention 谷歌验证码给我根据onclick函数的来源,但是我在javascript中的弱点无法在自动加载功能中进行修改任何人指导我如何在页面加载验证码自动显示时更改自动加载功能。重要的是即时通讯使用fancybox ajax选择为什么会有一些复杂.code提及

<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
<script type="text/javascript">
function showRecaptcha() {
        Recaptcha.create("6Lcxj-ASAAAAAJ-OV2Sw40GfzbODQNLOTKuEFPbU", 'captchadiv', {
        tabindex: 1,
        theme: "clean",
        callback: Recaptcha.focus_response_field
        });
}     
</script>

<div id="captchadiv"></div>

<input type="button" value="Change reCAPTCHA" onclick="showRecaptcha('captcha_div');"></input>

In ajax put Recaptcha.reload() as shown in following code 在ajax中放入Recaptcha.reload(),如以下代码所示

 $.ajax({ 
         type: 'POST', 
         url: "../yourpath", 
         data: $("#signupForm").serialize(), 
         datatype: "json", 

         success: function (response) {
             alert(response.message);
             if(response.message=="Captcha invalid"){

                   Recaptcha.reload();
                             }
         }, 
         error:  function(response, ajaxOptions, thrownError) {
             alert("Some problem in saving the record : " + response.message);
         }
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM