duanli5662 2014-11-27 17:23
浏览 141
已采纳

查找何时重新加载reCAPTCHA

I'm doing some research in CAPTCHAs' usability and I'm currently looking at reCAPTCHA from Google.

I'm trying to count the number of times a user reload a CAPTCHA because he can't solve it, but I can't seem to find a way to get that information. Basically, every time the user ask for a new CAPTCHA, I'd like to increment a counter. I'm using JS/PHP.

Thanks.

  • 写回答

2条回答 默认 最新

  • douqianrou9079 2014-11-27 19:28
    关注

    The HTML injected by the reCaptcha in PHP contains the following HTML for the reload button:

    <a title="Get a new challenge" id="recaptcha_reload_btn"><img alt="Get a new challenge" src="http://www.google.com/recaptcha/api/img/red/refresh.gif" id="recaptcha_reload" height="17" width="25"></a>
    

    This means you can add a Javascript event listener to the button and count the number of times it is clicked. This example uses jQuery to increment a global variable:

    var recaptcha_reloaded = 0;
    $(document).on("click", "#recaptcha_reload_btn", function() {
        recaptcha_reloaded++;
    });
    

    How you send this information once it is captured is up to you. One possibility is injecting it into a hidden input field on a form before it is submitted.

    Also note that this only counts the number of times the button was clicked, not the number of times it was actually reloaded. There is a delay between clicking the recaptcha reload button and when the recaptcha is actually reloaded, and additional clicks during this interval will be ignored.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line