Search code examples
jqueryhtmljsapi

Should I use Google's JSAPI in production code?


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?

Solution

  • 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.