using reCAPTCHA with ajax…javascript loading problem

前端 未结 7 2066
说谎
说谎 2021-02-14 04:08

I trying to implement reCAPTCHA in one of my forms,...but i am using ajax as the submission. (More specifically the prototype ajax.updater)

Once I submit and error check

7条回答
  •  [愿得一人]
    2021-02-14 04:27

    I have had similar issues with getting reCaptcha to play nicely when loaded into the page using jQuery's .load() method. Here is a page that has a novel solution: http://www.maweki.de/wp/2011/08/recaptcha-inside-a-with-jquery-ajax-or-load-dynamically-loaded-object/

    Basically the reCaptcha API uses document.write method to display the reCaptcha. When you get jQuery invloved this won't work. Use this PHP code in place of loading recaptcha.js

    
    

    It just does a find for document.write and replaces it with $(selector).append.

    Made my implementation work.

提交回复
热议问题