Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

None coder - Java script libraries are not up to date


coneill659

Question

1 answer to this question

Recommended Posts

  • 0
10 hours ago, coneill659 said:

Hubspot website grader says that java script libraries on the site are not up to date and need to be updated with security patch. What do I do to update this?

jQuery is a JavaScript library that simplifies programming. It makes it easy for non-developers to add code to websites like Squarespace, so you'll find lots of code examples on this forum that have been written in jQuery by people who are learning to code. These snippets of code need to load jQuery before they will work. 

For example, you'll find a line of code on your website in Settings > Advanced > Code Injection that looks like this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

This loads a very old and insecure version of jQuery known as version 2.2.0. In fact, on your site it appears more than once, but it shouldn't.

 

To update jQuery to the latest version, remove the outdated code (all of them), and add the latest version instead. You only need to add this once.

<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>

The example above is for version 3.5.1, which is the latest version of jQuery today (May 2020), but you should update this when a new vulnerability is discovered. If you are reading this post months or years later, you'll find details of the latest version here.

One word of caution. After you've updated jQuery, check that your code still works correctly. This is because the newest versions of jQuery may not contain all the functions from old jQuery libraries. If this is the case, you may need to re-write the code snippet that relies on jQuery.

 

  If this helps you, please click "Like" below  ⬇️

Edited by paul2009

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi! I'm Paul, an independent Squarespace Consultant since 2007 and founder of SF Digital, building the features that Squarespace didn't include. Our mini-extensions allow you to pick dates in any format, show prices in other currencies, take orders without payment or improve your cartI value honesty, integrity, transparency and respect . Links in my posts may refer to SF Digital products or may be affiliate links.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...