3 ms·
If you're worried about Google's reliability, you could always test for typeof(jQuery) !== 'undefined' before assuming it had loaded. Then, you can inject a sc
by Encosia 18y ago
If you're worried about Google's reliability, you could always test for typeof(jQuery) !== 'undefined' before assuming it had loaded. Then, you can inject a script element referencing a copy of jQuery on your server if it hadn't.
In practice, I would think the chances of Google's entire CDN going down are the very least of your worries though.
- ars 18y agoThat's quite an interesting idea, but I'd be worried about it running too soon, the browser doesn't give you a "gave up on downloading something" event. Google goes down more than you think - it's not usually that google itself is down, but rather that DNS didn't look them up, or some anoying routing issue. It's happened to me, so I know it does happen.