Title: jQuery console error being logged
Last modified: May 22, 2019

---

# jQuery console error being logged

 *  Resolved [Will Stocks](https://wordpress.org/support/users/willstockstech/)
 * (@willstockstech)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jquery-console-error-being-logged/)
 * Hi guys,
 * I don’t know if this actually affecting anything or not, but I’m seeing a console
   error being logged every time I visit my contact form page ([https://willstocks.co.uk/contact](https://willstocks.co.uk/contact)):
 * Uncaught ReferenceError: jQuery is not defined
    at contact:formatted:1944 (anonymous)
   @ contact:formatted:1944
 * Relating specifically to:
 *     ```
           (function($) {
               $('.wpcf7').on('wpcf7:spam', function(e) {
                   $('[name="g-recaptcha-response"]', $(this)).each(function() {
                       if ('' === $(this).val()) {
                           var $recaptcha = $(this).closest('.wpcf7-form-control-wrap');
                           wpcf7.notValidTip($recaptcha, wpcf7iqfix.recaptcha_empty);
                       }
                   });
               });
           }
           )(jQuery);
       ```
   
 * I assume it is throwing this error because jQuery has not fully loaded yet?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Will Stocks](https://wordpress.org/support/users/willstockstech/)
 * (@willstockstech)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jquery-console-error-being-logged/#post-11559156)
 * Out of curiosity… could this not be converted to a vanilla js snippet, rather
   than relying on jquery?
 *  Plugin Author [IQComputing](https://wordpress.org/support/users/iqcomputing/)
 * (@iqcomputing)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/jquery-console-error-being-logged/#post-11560598)
 * Hello,
 * Thank you for bringing this to our attention. It’s something we’re aware of and
   we are looking to convert this to vanilla JavaScript. This is an artifact from
   Contact Form 7 v5 which was pulled over in the diff. We believe it has something
   to do with deferred JavaScript ( jQuery at the top ). Whenever it hits the inline
   JavaScript it hasn’t quite loaded the jQuery yet, throws a console error but 
   proceed to function correctly once the deferred script has actually loaded.
 * If you are not having issues we will mark this thread as resolved for now but
   will reply here once we release an update with the snippet converted to vanilla
   JavaScript. Have a wonderful rest of your week!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘jQuery console error being logged’ is closed to new replies.

 * ![](https://ps.w.org/wpcf7-recaptcha/assets/icon.svg?rev=2003053)
 * [ReCaptcha v2 for Contact Form 7](https://wordpress.org/plugins/wpcf7-recaptcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcf7-recaptcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcf7-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcf7-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcf7-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcf7-recaptcha/reviews/)

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 2 replies
 * 2 participants
 * Last reply from: [IQComputing](https://wordpress.org/support/users/iqcomputing/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/jquery-console-error-being-logged/#post-11560598)
 * Status: resolved