What is integrity and crossorigin in javascript ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is integrity and crossorigin in javascript ?

I am seems integrity and crossorigin use in script Tag under Please explain it ,, i dont understand if i am remove it from script does not effect in my web document coding

4th Jan 2021, 3:17 AM
Sajid Ali
Sajid Ali - avatar
1 Answer
+ 1
A quick search on Google gives the answer(from https://intellipaat.com/community/27724/what-are-the-integrity-and-crossorigin-attributes#:~:text=An%20integrity%20attribute%20is%20used,the%20'same-origin' ): An integrity attribute is used to allow the browser to check the file source to ensure that the code is never loaded if the source has been manipulated. Crossorigin attribute is present when a request is loaded using 'CORS' which is now a requirement of SRI checking when not loaded from the 'same-origin'. Basically, the integrity attribute prevents the browser your program runs in to never open potentially dangerous scripts, while the crossorigin attribute is used to load files requiring the CORS method.
6th Jan 2021, 2:14 AM
Jianmin Chen
Jianmin Chen - avatar