APIs & Integrations

Not applicable

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

I have recently noticed in HubSpot that Jquery old version of code exists and when I audit report. I get jquery vulnerability and need to upgrade to a new version from 1.11.X to 3.3.3.

Kindly suggest how to get this problem solved with clear-cut steps and proceedings.
Preferably with screenshots.

Thank you!

0 Upvotes
2 Accepted solutions
matt_scott
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

Very hacky answer but this is the way others have suggested in the past,

Do a replace on the standard header includes in your template file:

{{ standard_header_includes|replace('<script src="/hs/hsstatic/jquery-libs/static-1.1/jquery/jquery-1.7.1.js"></script>','<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>') }}

Matthew Scott
Head of Development | Hubspot Solutions Architect

B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010


01926 334003

deeplydigital.co.uk

3 Morton Street, Leamington Spa, CV32 5SY, UK

View solution in original post

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

Thanks for jumping in, @Matt_Scott and @Toladigit!

If you just need to upgrade to version 1.7.x, you can also follow these steps.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
5 Replies 5
davidls7
HubSpot Employee
HubSpot Employee

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

I saw this post and thought it might be helpful to update it with some useful information from our ever changing and improving developer documentation. 

https://developers.hubspot.com/docs/cms/building-blocks/themes/hubspot-cms-boilerplate

It says that: 

jQuery

The HubSpot Theme boilerplate doesn't require jQuery in order to function. For older HubSpot accounts jQuery is loaded by default. Newer HubSpot accounts have jQuery disabled by default.

Historically HubSpot scripts required jQuery to function properly, so the domain-wide setting was there to help ensure compatibility. HubSpot scripts no longer use jQuery. Because JQuery is not required, and there are better ways for developers to include libraries that also work with source control. It is advised to disable the jQuery settings for new websites. 

Be aware if disabling jQuery on a domain that has an existing website - any landing pages or existing web pages you may have could break if they depend on jQuery.

If you wish to use jQuery on your new website it is recommended that you use the latest version of jQuery. There are two easy ways to do that:

  • Upload the latest version of jQuery to your developer file system and use require_js to load it where and when you need it.
  • Use a CDN you trust, and use require_js to load jQuery where and when you need it.




David Leonard-Scully
0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

Thanks for jumping in, @Matt_Scott and @Toladigit!

If you just need to upgrade to version 1.7.x, you can also follow these steps.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Not applicable

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

Hi LearnCab, here's a link that would help with your issue

0 Upvotes
matt_scott
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

Very hacky answer but this is the way others have suggested in the past,

Do a replace on the standard header includes in your template file:

{{ standard_header_includes|replace('<script src="/hs/hsstatic/jquery-libs/static-1.1/jquery/jquery-1.7.1.js"></script>','<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>') }}

Matthew Scott
Head of Development | Hubspot Solutions Architect

B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010


01926 334003

deeplydigital.co.uk

3 Morton Street, Leamington Spa, CV32 5SY, UK
0 Upvotes
vernierd
Participant | Elite Partner
Participant | Elite Partner

How do I upgrade Jquery version in HubSpot for the pages?

SOLVE

And where exactly do I do this replace this js file? Not that familiar with the design manager tool. I need to upgrade just for one page because a countdown timer script I bought requires it. 

 

Would be great if you could help me out. 

 

regards,

Dominique

0 Upvotes