Title: jQuery missing
Last modified: April 8, 2021

---

# jQuery missing

 *  [aronambrosiani](https://wordpress.org/support/users/aronambrosiani/)
 * (@aronambrosiani)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/jquery-missing/)
 * hi, I get a jQuery error in the console – “ReferenceError: Can’t find variable:
   jQuery”
 * …it points to a script added by Gallery Custom Links, included below. Might there
   be a bug in dependency loading or do you think something is broken in the wordpress
   setup outside of this plugin?
 * // Used by Gallery Custom Links to handle tenacious Lightboxes
    jQuery(document).
   ready(function() {
 *  function mgclInit() {
    if (jQuery.fn.off) { jQuery(‘.no-lightbox, .no-lightbox
   img’).off(‘click’); // jQuery 1.7+ } else { jQuery(‘.no-lightbox, .no-lightbox
   img’).unbind(‘click’); // < jQuery 1.7 } jQuery(‘a.no-lightbox’).click(mgclOnClick);
 *  if (jQuery.fn.off) {
    jQuery(‘a.set-target’).off(‘click’); // jQuery 1.7+ } 
   else { jQuery(‘a.set-target’).unbind(‘click’); // < jQuery 1.7 } jQuery(‘a.set-
   target’).click(mgclOnClick); }
 *  function mgclOnClick() {
    if (!this.target || this.target == ” || this.target
   == ‘_self’) window.location = this.href; else window.open(this.href, this.target);
   return false; }
 *  // From WP Gallery Custom Links
    // Reduce the number of conflicting lightboxes
   function mgclAddLoadEvent(func) { var oldOnload = window.onload; if (typeof window.
   onload != ‘function’) { window.onload = func; } else { window.onload = function(){
   oldOnload(); func(); } } }
 *  mgclAddLoadEvent(mgclInit);
    mgclInit();
 *  });
    </script>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjquery-missing%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘jQuery missing’ is closed to new replies.

 * ![](https://ps.w.org/gallery-custom-links/assets/icon-256x256.png?rev=2588900)
 * [Gallery Custom Links](https://wordpress.org/plugins/gallery-custom-links/)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-custom-links/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-custom-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-custom-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-custom-links/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [aronambrosiani](https://wordpress.org/support/users/aronambrosiani/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/jquery-missing/)
 * Status: not resolved