Title: jQuery code before footer
Last modified: September 4, 2019

---

# jQuery code before footer

 *  [nmueller](https://wordpress.org/support/users/nmueller/)
 * (@nmueller)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/jquery-code-before-footer/)
 * Hello,
 * I use this plugin in combination with Contact Form 7.
    After I enabled the plugin,
   the following code will be added before the footer.
 * Now I get the error “Uncaught ReferenceError: jQuery is not defined”, because
   the script below will be loaded before the jquery embed script.
 * Do you have a solution for this problem?
 * Thank you!
 *     ```
       <script>
           jQuery(document).ready(function($) {
               var $checkboxes;
               function storekey() {
                   var keysVal = $checkboxes.map(function() {
                       if(this.checked) return $(this).attr('data-key');
                   }).get().join(',');
                   $("input[name='fieldVal']").val(keysVal);
               }
               $(function() {
                   $checkboxes = $("input[class='listCheckbox']").change(storekey);
               });
           });
       </script>
       ```
   

Viewing 1 replies (of 1 total)

 *  [wordpresstikweb](https://wordpress.org/support/users/abdultikweb/)
 * (@abdultikweb)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/jquery-code-before-footer/#post-11900913)
 * Hello,
 * Please make sure jquery is loaded before this script. This kind of issue might
   happen because of your theme or plugin that conflicts with other. Try changing
   to new theme (exm: twenty nineteen). If the problem still persist, disable all
   the plugins except those two plugins (MailPoet 3 and Add-on Contact Form 7 – 
   MailPoet 3) and see if the problem still persist.
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘jQuery code before footer’ is closed to new replies.

 * ![](https://ps.w.org/add-on-contact-form-7-mailpoet/assets/icon.svg?rev=1731413)
 * [Add-on Contact Form 7 – MailPoet 3](https://wordpress.org/plugins/add-on-contact-form-7-mailpoet/)
 * [Support Threads](https://wordpress.org/support/plugin/add-on-contact-form-7-mailpoet/)
 * [Active Topics](https://wordpress.org/support/plugin/add-on-contact-form-7-mailpoet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-on-contact-form-7-mailpoet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-on-contact-form-7-mailpoet/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wordpresstikweb](https://wordpress.org/support/users/abdultikweb/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/jquery-code-before-footer/#post-11900913)
 * Status: not resolved