Should I use Google's JSAPI in production code?

Frank Krueger picture Frank Krueger · Jul 10, 2009 · Viewed 43.3k times · Source

Possible duplicate of:

should-i-link-to-google-apis-cloud-for-js-libraries

also many other discussions, including:

Where do you include the jQuery library from? Google JSAPI? CDN? Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail


I was looking at the Tiny MCE plugin example and saw this code in the head of the document:

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
    google.load("jquery", "1.3");
</script>

I've never seen this way to load jQuery.

  • Is this recommended for production?
  • What is the benefit of this method?

Answer

Keith Bentrup picture Keith Bentrup · Jul 10, 2009

Yes, definitely. Google encourages it. Everyone benefits. It's more likely to be in their cache, and it's one less file that you have to serve.