I have done that in the past, but there is an upside to not doing it that way. If you use a CDN, and the user has already loaded it from the CDN via another site, that's only less thing to download. So it can make your site seem faster for a subset of users.
That might be doable if the library is jquery or whatever, but how are you going to replace google maps? Hosting an OSM tiles server is non-trivial, and I highly doubt that you'll be able to host it with better reliability than google.
jQuery isn't Google Maps. Different tools have different solutions.
You can save your site by self-hosting jQuery, but if your business depends on Google Maps you should at least handle failure more gracefully than a blank screen.
Comments
What's your strategy for dealing with jquery not getting loaded?
That's going to be an issue regardless of you check whether the script is loaded or not.
Host it on your own infrastructure so that it's the same reliability as your site itself?
I have done that in the past, but there is an upside to not doing it that way. If you use a CDN, and the user has already loaded it from the CDN via another site, that's only less thing to download. So it can make your site seem faster for a subset of users.
That hasn't been true for years due to timing attacks. See: https://news.ycombinator.com/item?id=24745748
Did not know this had changed. Thanks for the information.
That might be doable if the library is jquery or whatever, but how are you going to replace google maps? Hosting an OSM tiles server is non-trivial, and I highly doubt that you'll be able to host it with better reliability than google.
jQuery isn't Google Maps. Different tools have different solutions.
You can save your site by self-hosting jQuery, but if your business depends on Google Maps you should at least handle failure more gracefully than a blank screen.