(2)入门指南——(5)下载jquery(Downloading jQuery)

No installation is required. To use jQuery, we just need a publicly available copy of the file, whether that copy is on an external site or our own. As JavaScript is an interpreted language, there is no compilation or build phase to worry about. Whenever we need a page to have jQuery available, we will simply refer to the file's location from a <script>element in the HTML document.

无需安装。为了使用jquery我们需要一份这个文件公开可用的复制,无论是在一个外部网站上还是我们自己网站上获取的。正如js是解释型的语言,不必担心编译和生成阶段。无论什么时候我们需要让jquery在一个网页上可用,我们只需要简单的在html文档中的<script>元素中添加上文件的地址就可以了。

The official jQuery website (http://jquery.com/) always has the most up-to-date, stable version of the library, which can be downloaded right from the home page of the site. Several versions of jQuery may be available at any given moment; the most appropriate for us as site developers will be the latest uncompressed version of the library. This can be replaced with a compressed version in production environments.

官方站点(http://jquery.com)总是拥有最新的稳定的jquery版本,你可以直接从网站的首页下载。在任何时刻都有几个jquery的版本是有效的,对我们这些作为网站的开发者的人来说,最合适的版本是最新的未压缩的版本。在生产环境中可以使用压缩版本代替。


As jQuery's popularity has grown, companies have made the file freely available through their Content Delivery Networks(CDNs). Most notably, Google (http://code.google.com/apis/ajaxlibs/documentation/), and Microsoft (http://www.asp.net/ajax/cdn) offer the file on powerful, low-latency servers distributed around the world for fast download regardless of the user's location. While a CDNhosted copy of jQuery has speed advantages due to server distribution and caching, using a local copy can be convenient during development. Throughout this book we'll use a copy of the file stored on our own system, which will allow us to run our code whether we're connected to the Internet or not.

随着jquery流行性的增长,一些公司使这些文件可以通过他们的内容分发网络(CDNs)变的免费可用。最显著的是Google(http://code.google.com/apis/ajaxlibs/documentation/)和微软的(http://www.asp.net/ajax/cdn)在有力的低延迟的分布于全世界的服务器商提供了这些文件,用以快速下载而不用关心用户的位置。虽然由于分布式服务器和缓存的作用使用CDN主机上的jquery拥有着速度优势,在开发时使用本地文件是很方便的。在整本书上,我门将使用存储在我们自己的系统中的本地文件,这将让我们无论联网与否都可以运行我们的代码。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值