All 3rd party javascript is broken. It's simply a fact. 15 years into the Web, still nobody has learned to check their external references before using them. Even google gets it wrong pretty much every single time.<p>If you really need to use somebody else's script on your site, the only thing you can do to protect yourself is to also add global exception handling to the page.<p>It would be nice if we could expect giant companies that publish Javascript APIs for a living to actually check that their Javascript works in most standard cases, but that's just not the way it works in the real world.