JS Error with Elementor + jQuery in footer
-
When using this plugin with Elementor forms, this piece of javascript gets inserted just before the form:
<script>
jQuery(document).ready(function() {
jQuery(".elementor-form").on('submit', function() {
var submittedForm = jQuery(this);
setTimeout(function() {
var turnstileElement = submittedForm.find('.cf-turnstile');
if (turnstileElement.length > 0) {
var uniqueId = 'cf-turnstile-elementor-' + new Date().getTime();
turnstileElement.attr('id', uniqueId);
turnstile.reset('#' + uniqueId);
}
}, 2500);
});
});
</script>However, when the actual jQuery JS file is loaded in the footer of the site, jQuery does not exist yet at this point, resulting in a JS error in the browser console:
ReferenceError: Can’t find variable: jQuery
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.