我应该在生产代码中使用Google的JSAPI吗? [英] Should I use Google's JSAPI in production code?

查看:125
本文介绍了我应该在生产代码中使用Google的JSAPI吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:

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



还有很多其他讨论,包括:

你从哪里加入jQuery库? Google JSAPI? CDN?
使用Google托管的jQuery的最佳方式,但是回退到我在Google上托管的图书馆






我在查看Tiny MCE插件示例,并在文档的头部中看到以下代码:

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

我从来没有见过这种方式来加载jQuery。




  • 建议用于制作吗?

  • 这种方法的好处是什么?


解决方案

是的,当然。 Google鼓励。每个人都受益它更有可能在他们的缓存中,而且这是一个你不得不服务的文件。


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?

解决方案

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.

这篇关于我应该在生产代码中使用Google的JSAPI吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆