Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the integrity value for a jquery version for script

Tags:

jquery

I have this code from somewhere

<script src="https://code.jquery.com/jquery-1.12.3.min.js" integrity="sha256-aaODHAgvwQW1bFOGXMeX+pC4PZIPsvn2h1sArYOhgXQ=" crossorigin="anonymous"></script>

But if I want to use https://code.jquery.com/jquery-3.3.1.min.js in https://code.jquery.com/jquery/

how to get the corresponding integrity value for jquery-3.3.1.min.js?

like image 521
user2761895 Avatar asked Jul 09 '18 21:07

user2761895


People also ask

What is integrity attribute in script tag?

The integrity attribute allows a browser to check the fetched script to ensure that the code is never loaded if the source has been manipulated. Subresource Integrity (SRI) is a W3C specification that allows web developers to ensure that resources hosted on third-party servers have not been altered.


2 Answers

Use https://www.srihash.org/ for generate link

https://code.jquery.com/jquery-3.3.1.min.js

generated as

<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script>
like image 141
mscdeveloper Avatar answered Sep 27 '22 02:09

mscdeveloper


Is this something that you are looking for?

<script
  src="https://code.jquery.com/jquery-3.3.1.js"
  integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
  crossorigin="anonymous"></script>

I found this from here -

jQuery Core – All Versions

like image 37
Shreyas Avatar answered Sep 25 '22 02:09

Shreyas