Multiple versions of Jquery on a page

Snoopy1
Tourist
7 0 4

In Firefox's firebug, I noticed two versions of Jquery is loaded.  The first one is the one I specified in the theme.liquid, version 1.11.1 and the second one is injected by shopify, version 1.10.2.

It appears the 1.10.2 version is injected from {{ content_for_header }}

How do I remove the injected version?  I noticed several shopify's shop have the same problem.  Some sites have 3 or more versions of jquery included.

including multiple version of jquery can potentially cause problem

 

Snoopy1
Tourist
7 0 4

Ok, I figured it out.  It is shopify's product review app.

once i removed that review app, the jquery injection is gone.

I wonder why shopify's review app does that.  It should not inject jquery library if it exist

0 Likes
James_MacAulay
Shopify Staff (Retired)
Shopify Staff (Retired)
157 0 15

Hi Billi, the Product Reviews app uses jQuery's `noConflict` method to ensure that it does not clash with other versions on the page.

James MacAulay, Shopify Developer
0 Likes
Michaël_G_
Shopify Expert
73 1 45

Hi,

While trying to reduce the page load of our new theme, I also encountered this issue of multiple jQuery, leading to the same conclusion that Product Review inject another version of jQuery.

While not considerably harmful, it's still adds additional load time to the page. Wouldn't it be possible for you to only add the jQuery if no version has been included or, even better, make adding the jQuery library as part of the installation process of the app, so that we can remove it if we are already including another version?

wb1
Shopify Partner
40 1 4

+1 on conditional jQuery loading here, it's an extra large thread-blocking payload that is not needed for many people

Mark_Brown1
Shopify Partner
4 0 0

especially old versions of jquery

0 Likes