A client’s current version of jquery was flagged as a security concern so I followed this guide to upgrade them to the latest version:
As per the guide, I tested the pages by added ?latest_jquery=true to the end of the URL, and upon Inspecting discovered that both the new and the old versions of jQuery are present. But I have no idea where the old version is coming from.
I’ve scoured the files to see if it’s being manually inserted somewhere and it doesn’t appear to be.
The toggle to include jQuery is still enabled. But disabling that stops any and all jQuery from working, even if I’ve manually added jQuery into the <head>, either going into the files directly and doing it there, or by adding it the header from the settings.
All that being said, I’m beginning to wonder if it’s a side effect of using the old template builder (the old drag and drop one). Could that be the issue?
Thanks in advance for any help, this has been doing my head in.
Hi, @adamschwarz
Welcome to our community. Thanks for including the troubleshooting steps you’ve already tried. I’d like to invite some of our community champions to the conversation — hey @GiantFocal @Mike_Eastwood @dsmarion, do you have any additional suggestions or next steps for @adamschwarz to try in their troubleshooting?
Thank you very much for taking a look! — Jaycee
Ouch, I feel your pain @adamschwarz
Sounds like you found the switch in HubSpot that sets up JQuery:
Settings (cog icon, top right) > Content (left menu, bottom) > Pages (sub menu) > Templates (tab)
I’ve encountered several Themes that load libraries (including JQuery) multiple times, in multiple places!
It’s a tedious job - seek and destroy - look at the page source to find out where the library loads. Then rummage around to find the offending file.
First, use the HubSpot Development Tools to fetch a backup copy to your local machine (and add it to version control).
Depending on how many pages there are on the site I typically create a Child version of the Theme, then clone the modules and replace the Modules, and the template, on all of the pages. This gives me full control over what’s loaded, and when, so I can get super fast page loads.
I usually rewrite the JQuery to plain Javascript, no I don’t get out much.
Have fun
Mike
p.s. thank you for the mention @Jaycee_Lewis
Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.