by tghw · 13y ago · 0 comments
<script src="scriptloader.js"></script>
<script src="jquery.min.js" data-md5="a1b2..."></script>
Then you could decide to not load scripts that do not match the correct hash. It could even ping the server to alert it to broken scripts.This protects against any external scripts being unexpectedly modified, e.g. someone MITM your jquery source.
Oh, also, those scripts can themselves load in other scripts you haven't checksummed.
This is madness you're suggesting.
Because you might be using a CDN for performance and bandwidth benefits.
If you relying on a third party piece of code that you allow to change at any time, then it is very difficult to do any release testing to give you a known set of conditions your application should work under.
How is checking the validity of the scripts that run on your site madness??