@razamirza mentioned here: jquery/codeorigin.jquery.com#20 (comment)
Is there any plan to add support for SRI to jQuery.getScript()? http://api.jquery.com/jQuery.getScript/
I think it would be worth considering adding support to check a script on the outside, however probably this is worthy of an extension until all browsers support fetch+SRI/WebCrypto natively.
I’d prefer we just add options to
jQuery.ajax()
that let you set attributes on the tag before it is added to the DOM. So something like this:which would inject a tag like:
I suppose we could have
jQuery.getScript( url, [, attrs] [, success] )
as well. The implementation would end up mapping anyjQuery.getScript()
call intojQuery.ajax()
anyway since this additional information has to make it all the way to the script transport.