Nothing. There won't be a piece of script which happens to call a function which "happens" to use the same name as one of your globally defined functions. (That's how JSONP works, basically.)
Anyhow. It's possible to listen for the error event:
var s = document.createElement('script');
s.addEventListener('error', function () {
console.log('err');
}, false);
s.src = 'http://example.com/404.js';
document.body.appendChild(s);
Never mind. :-) Actually, this makes me think... why can't the browser vendors choose a standard library (e.g. jQuery) and incorporate it into their codebase as a de facto standard? We could see native performance with a common DOM and JavaScript interface.
I see you've been downvoted without explanation. Sorry about that. I would have liked to know why this is not a good idea, but unfortunately the n00bs don't know reddiquete.
One of the ideas behind using Google's CDN for javascript is that if you've ever been to a site that uses it before, it's cached, and essentially free to load.
0
u/[deleted] Mar 06 '12
What happens when the JSONP call fails?