Title: Uncaught ReferenceError: jQuery is not defined
Last modified: August 30, 2016

---

# Uncaught ReferenceError: jQuery is not defined

 *  Resolved [j.johnston](https://wordpress.org/support/users/jjohnston-1/)
 * (@jjohnston-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-5/)
 * Hi thhake,
 * I have deactivated your modified “Picasa and Google Plus Express” plugin v2.2.10,
   which was working fine on my site, and activated your newer and more official“
   Photo Express for Google” plugin v0.3.2. And now PhotoSwipe won’t load. I am 
   correctly authenticating to Google and retrieving my gallery of images, which
   are being properly rendered on the page (using a [peg-gallery] shortcode), but
   when I click on an individual image (which should launch it in PhotoSwipe) it
   instead just opens the image by itself in the browser window.
 * I noticed the following error in my browser console on page load:
    Uncaught ReferenceError:
   jQuery is not defined (anonymous function) @ (index):575
 * And the line in question is the first line in the following script:
 *     ```
       <script>
                       jQuery(document).ready(function () {
                           options = {
       	                    shareEl: true,
       	                    fullscreenEl:true,
       	                    closeEl:true,
       	                    counterEl:true                    };
                           // ready event, get a list of unique rel values for the photoswiped images
                           var rels = [];
                           var rel = '';
                           jQuery('a.photoswipe').each(function () {
                               // for each photoswipe rel, if the rel value doesn't exist yet,
                               // add it to our array
                               rel = jQuery(this).attr('rel');
                               if (rel != undefined) {
                                   if (!peg_in_array(rels, rel)) {
                                       // add this rel to our array
                                       rels.push(jQuery(this).attr('rel'));
                                   }
                               }
                           });
   
                           // check to see if our rels array has been built and has any values
                           if (rels.length > 0) {
                               // we have at least one individual set of unique rels, setup photoswipe
                               // for each
                               jQuery.each(rels, function (key, value) {
                                   // get this rel and create the collection
       	                        initPhotoSwipeFromDOM(jQuery('a.photoswipe[rel=' + value + ']'),options)
                               });
                               //Check if there are any images without any relation (i.e. single images)
       	                    jQuery('a.photoswipe:not([rel])').each(function(key, value){
       		                    initPhotoSwipeFromDOM(jQuery(this),options);
       	                    });
                           } else {
                               // we didn't get any rels, so attempt without rel checking
       	                    initPhotoSwipeFromDOM(jQuery('a.photoswipe'),options);
                           }
   
                       });
   
                       function peg_in_array(array, value) {
                           for (var i = 0; i < array.length; i++) {
                               if (array[i] === value) {
                                   return true;
                               }
                           }
                           return false;
                       }
                   </script>
       ```
   
 * Are you not including jQuery on page load? Or is something else going on? Do 
   I need to explicitly load jQuery via another plugin?
 * Thank you!
 * WordPress 4.3.1 running Pictorico theme.
    Running PHP version: 5.5.28
 * [https://wordpress.org/plugins/photo-express-for-google/](https://wordpress.org/plugins/photo-express-for-google/)

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

 *  Plugin Author [thhake](https://wordpress.org/support/users/thhake/)
 * (@thhake)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-5/#post-6599197)
 * Hey,
 * thank you very much for this detailed bug report. You are absolutely right, I
   forgot to include jQuery explicitly. I didn’t notice this issue, as I only tested
   it with jQuery based themes.
 * I’m working on a fix.
 *  Plugin Author [thhake](https://wordpress.org/support/users/thhake/)
 * (@thhake)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-5/#post-6599198)
 * Can you give it a try with the most current version on github? I fixed it there,
   but can’t verify if it works locally.
 * You can download it [here](https://github.com/thake/photo-express/archive/master.zip).
 * Thanks!
 *  Thread Starter [j.johnston](https://wordpress.org/support/users/jjohnston-1/)
 * (@jjohnston-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-5/#post-6599201)
 * Hi thhake,
 * Your fix is working nicely, and jQuery is now loading allowing PhotoSwipe to 
   launch properly.
 * Thank you very much!

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

The topic ‘Uncaught ReferenceError: jQuery is not defined’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/photo-express-for-google.svg)
 * [Photo Express for Google](https://wordpress.org/plugins/photo-express-for-google/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photo-express-for-google/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photo-express-for-google/)
 * [Active Topics](https://wordpress.org/support/plugin/photo-express-for-google/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photo-express-for-google/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photo-express-for-google/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [j.johnston](https://wordpress.org/support/users/jjohnston-1/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-5/#post-6599201)
 * Status: resolved