• Resolved sasdts

    (@sasdts)


    Hi,

    I just noticed that the plugin doesn’t work on sites where jQuery is loaded in the footer.

    Can the jQuery code be rewritten in vanilla Javascript to ensure compatibility?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Elliot Sowersby

    (@elliotvs)

    Hi,

    Thanks for the message.

    It seems to be working fine on my end with jQuery deferred.

    What part of the plugin is not working in your case?

    Thread Starter sasdts

    (@sasdts)

    Uncaught ReferenceError: jQuery is not defined

    Plugin Author Elliot Sowersby

    (@elliotvs)

    Hi,

    Is the Turnstile widget still showing up on the form?

    Thread Starter sasdts

    (@sasdts)

    Hi Elliot,

    no, sorry for the confusion, jQuery is not loaded deferred, it’s enqueued in the footer, so when this inline JS is called, the jQuery library has not loaded:

    <script> jQuery(document).ready(function() { if (jQuery(‘#cf-turnstile iframe’).length <= 0) { setTimeout(function() { turnstile.remove(‘#cf-turnstile’); turnstile.render(‘#cf-turnstile’, { sitekey: ‘xxxxx’, }); }, 200); } }); </script>

    I tested with a non-interactive widget, and can confirm that the widget displays and functions correctly.

    Plugin Author Elliot Sowersby

    (@elliotvs)

    Hi,

    Please could you update to the latest version and give it a try now?

    Thread Starter sasdts

    (@sasdts)

    Hi Elliot,

    I just updated, checked, and yes, the JS error is gone.

    Many thanks for your swift response.

    Plugin Author Elliot Sowersby

    (@elliotvs)

    Awesome no problem!

    Let me know if you need any more help.

    It would be much appreciated if you could leave a review of the plugin here: https://www.ads-software.com/support/plugin/simple-cloudflare-turnstile/reviews/#new-post ??

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Javascript error if jQuery is enqueued in the footer’ is closed to new replies.