I tried to insert jQuery into the page through the Chrome DevTools console and I was getting this error. Here is the code I used:
let script = document.createElement('script'); script.src = 'https://code.jquery.com/jquery-3.2.1.min.js'; script.crossorigin = 'anonymous'; script.integrity = 'sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4='; document.head.appendChild(script);
The solution was to change crossorigin to crossorigin :
let script = document.createElement('script'); script.src = 'https://code.jquery.com/jquery-3.2.1.min.js'; script.crossorigin = 'anonymous'; script.integrity = 'sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4='; document.head.appendChild(script);
source share