Downloading jQuery
Compressed and uncompressed copies of jQuery files are available. The uncompressed file is best used during development or debugging; the compressed file saves bandwidth and improves performance in production. You can also download a sourcemap file for use when debugging with a compressed file. The map file is not required for users to run jQuery, it just improves the developer's debugger experience. As of jQuery 1.11.0/2.1.0 the //# sourceMappingURL
comment is not included in the compressed file.
To locally download these files, right-click the link and select "Save as..." from the menu.
linkjQuery
For help when upgrading jQuery, please see the upgrade guide most relevant to your version. We also recommend using the jQuery Migrate plugin.
Download the compressed, production jQuery 3.2.1
Download the uncompressed, development jQuery 3.2.1
Download the map file for jQuery 3.2.1
You can also use the slim version:
Download the compressed, production jQuery 3.2.1 slim build
Download the uncompressed, development jQuery 3.2.1 slim build
Download the map file for the jQuery 3.2.1 slim build
linkDownloading jQuery using npm
jQuery is registered as a package on npm. You can install the latest version of jQuery with the command:
1
|
npm install jquery
|
This will install jQuery in the node_modules
directory. Within node_modules/jquery/dist/
you will find an uncompressed release, a compressed release, and a map file.
linkDownloading jQuery using Bower
jQuery is also registered as a package with Bower. You can install the latest version of jQuery with the command:
1
|
bower install jquery
|
This will install jQuery to Bower's install directory, the default being bower_components
. Within bower_components/jquery/dist/
you will find an uncompressed release, a compressed release, and a map file.
The jQuery Bower package contains additional files besides the default distribution. In most cases you can ignore these files, however if you wish to download the default release on its own you can use Bower to install jQuery from one of the above urls instead of the registered package. For example, if you wish to install just the compressed jQuery file, you can install just that file with the following command:
1
|
bower install https://code.jquery.com/jquery-3.2.1.min.js
|
linkjQuery Migrate Plugin
We have created the jQuery Migrate plugin to simplify the transition from older versions of jQuery. The plugin restores deprecated features and behaviors so that older code will still run properly on newer versions of jQuery. Use the uncompressed development version to diagnose compatibility issues, it will generate warnings on the console that you can use to identify and fix problems. Use the compressed productionversion to simply fix compatibility issues without generating console warnings.
There are two versions of Migrate. The first will help you update your pre-1.9 jQuery code to jQuery 1.9 up to 3.0. You can get that version here:
Download the compressed, production jQuery Migrate 1.4.1
Download the uncompressed, development jQuery Migrate 1.4.1
The second version helps you update code to run on jQuery 3.0 or higher, once you have used Migrate 1.x and upgraded to jQuery 1.9 or higher:
Download the compressed, production jQuery Migrate 3.0.0
Download the uncompressed, development jQuery Migrate 3.0.0
linkCross-Browser Testing with jQuery
Be sure to test web pages that use jQuery in all the browsers you want to support. The Microsoft Developer Resources site makes available virtual machines for testing many different versions of Internet Explorer. Older versions of other browsers can be found at oldversion.com.
linkjQuery Pre-Release Builds
The jQuery team is constantly working to improve the code. Each commit to the Github repo generates a work-in-progress version of the code that we update on the jQuery CDN. These versions are sometimes unstable and never suitable for production sites. We recommend they be used to determine whether a bug has already been fixed when reporting bugs against released versions, or to see if new bugs have been introduced.
Download the work-in-progress jQuery build
linkUsing jQuery with a CDN
CDNs can offer a performance benefit by hosting jQuery on servers spread across the globe. This also offers an advantage that if the visitor to your webpage has already downloaded a copy of jQuery from the same CDN, it won't have to be re-downloaded.
linkjQuery's CDN provided by MaxCDN
The jQuery CDN supports Subresource Integrity (SRI) which allows the browser to verify that the files being delivered have not been modified. This specification is currently being implemented by browsers. Adding the new integrity attribute will ensure your application gains this security improvement as browsers support it.
To use the jQuery CDN, just reference the file in the script tag directly from the jQuery CDN domain. You can get the complete script tag, including Subresource Integrity attribute, by visiting https://code.jquery.com and clicking on the version of the file that you want to use. Copy and paste that tag into your HTML file.
Starting with jQuery 1.9, sourcemap files are available on the jQuery CDN. However, as of version 1.10.0/2.1.0 the compressed jQuery no longer includes the sourcemap comment in CDN copies because it requires the the uncompressed file and sourcemap file to be placed at the same location as the compressed file. If you are maintaining local copies and can control the locations all three files, you can add the sourcemap comment to the compressed file for easier debugging.
To see all available files and versions, visit https://code.jquery.com
linkOther CDNs
The following CDNs also host compressed and uncompressed versions of jQuery releases. Starting with jQuery 1.9 they may also host sourcemap files; check the site's documentation.
Note that there may be delays between a jQuery release and its availability there. Please be patient, they receive the files at the same time the blog post is made public. Beta and release candidates are not hosted by these CDNs.
linkAbout the Code
jQuery is provided under the MIT license.
The code is hosted and developed in the jQuery GitHub repository. If you've spotted some areas of code that could be improved, please feel free to discuss it on the Developing jQuery Core Forum. If you'd like to participate in developing jQuery, peruse our contributor site for more information.
To find and download plugins developed by jQuery contributors, please visit the Plugins site. Plugin authors are responsible for maintenance of their plugins. Feedback on plugins should be directed to the plugin author, not the jQuery team.
linkBuild from Git
Note: To just use the latest work-in-progress version of jQuery, please try the jQuery Pre-Release Build described above.
All source code is kept under Git revision control, which you can browse online. The repository's README has more information on building and testing your own jQuery, as well as instructions on creating a custom build that excludes some APIs to reduce file size.
If you have access to Git, you can connect to the repository here:
1
|
git clone git://github.com/jquery/jquery.git
|
You can also check out and build a specific version of jQuery from GitHub:
1
2
|
git clone git://github.com/jquery/jquery.git
git checkout 1.2.6
|
Downloading jQuery
Compressed and uncompressed copies of jQuery files are available. The uncompressed file is best used during development or debugging; the compressed file saves bandwidth and improves performance in production. You can also download a sourcemap file for use when debugging with a compressed file. The map file is not用戶運行所需jQuery,只是提高了開發人員的調試經驗。 在jQuery 1.11.0/2.1.0 / / # sourceMappingURL
評論是 不包括 在壓縮文件中。
本地下載這些文件,右鍵單擊鏈接並選擇“另存為… 從菜單中”。
鏈接 jQuery
尋求幫助當升級jQuery,請參閱 升級指南 與你最相關的版本。 我們也推薦使用 jQuery插件遷移 。
您還可以使用苗條版本:
鏈接 下載jQuery使用npm
jQuery是注冊為 一個包 在 npm 。 你可以安裝最新版本的jQuery命令:
1
|
npm安裝jquery
|
這將安裝jQuery node_modules
目錄中。 在 node_modules / jquery / dist /
你會發現一個未壓縮的版本,一個壓縮版本,和一個映射文件。
鏈接 下載jQuery使用鮑爾
jQuery還注冊作為一個包 鮑爾 。 你可以安裝最新版本的jQuery命令:
1
|
鮑爾安裝jquery
|
這將安裝jQuery鮑爾的安裝目錄,默認 bower_components
。 在 bower_components / jquery / dist /
你會發現一個未壓縮的版本,一個壓縮版本,和一個映射文件。
jQuery鮑爾包包含額外的文件除了默認的分布。 在大多數情況下可以忽略這些文件,但是如果您希望下載默認版本的可以使用鮑爾安裝jQuery從上面的url,而不是注冊包。 例如,如果您希望安裝jQuery的壓縮文件,你可以安裝,文件使用下面的命令:
1
|
鮑爾安裝https: / /code.jquery.com/jquery-3.2.1.min.js
|
鏈接 jQuery插件遷移
我們創建了 jQuery插件遷移 從老版本的jQuery來簡化轉變。 插件恢復棄用功能和行為,這樣老代碼仍將jQuery的較新版本上運行正常。 使用 未壓縮的發展 版本兼容性問題診斷,它將生成警告控制台,您可以用它來識別和解決問題。 使用 壓縮生產 版本簡單地解決兼容性問題,沒有生成控制台警告。
有兩個版本的遷移。 第一個將幫助您更新您的pre - 1.9 jQuery代碼jQuery 1.9到3.0。 在這里你可以得到這個版本:
第二個版本可以幫助你更新代碼運行在jQuery 3.0或更高版本, 一旦你使用遷移1。 x和升級到jQuery 1.9或更高版本 :
鏈接 與jQuery跨瀏覽器測試
一定要在所有的瀏覽器中測試網頁,使用jQuery你想支持。 的 微軟的開發人員資源 網站提供 虛擬機 用於測試許多不同版本的Internet Explorer。 可以發現舊版本的瀏覽器 oldversion.com 。
鏈接 jQuery預發行版本
jQuery團隊不斷努力改善代碼。 每個提交到Github回購生成一個工作版本的代碼,我們更新jQuery的CDN。 這些版本有時不穩定,不適合生產基地。 我們建議他們被用來決定是否一個bug報告bug時已經固定的發布版本,或是否已引入新的錯誤。
鏈接 使用jQuery的CDN
發布商 可以通過在服務器上托管jQuery提供性能優勢在全球范圍內傳播。 這也提供了一個優勢,如果用戶訪問你的網頁已經下載jQuery從同一CDN的副本,它不會重新下載。
鏈接 jQuery提供的CDN MaxCDN的
jQuery CDN支持 子資源的完整性 (SRI),允許瀏覽器確認交付的文件沒有被修改。 這 規范 目前正在實施的瀏覽器。 添加新屬性完整性將確保您的應用程序獲得這個安全改進瀏覽器都支持它。
使用jQuery CDN,只是參考的文件直接從jQuery腳本標記CDN域。 你可以得到完整的腳本標記,包括子資源整體屬性,通過訪問 https://code.jquery.com ,點擊您想要使用的版本的文件。 標簽復制並粘貼到您的HTML文件。
從jQuery 1.9開始, sourcemap文件 jQuery CDN上都是可用的。 然而,隨着版本1.10.0/2.1.0壓縮jQuery不再包含在CDN副本sourcemap評論,因為它需要的未壓縮的文件和sourcemap文件壓縮文件放置在相同的位置。 如果你是維護本地副本,可以控制這三個文件的位置,您可以添加sourcemap評論到壓縮文件更易於調試。
看到所有可用的文件和版本,請訪問 https://code.jquery.com
鏈接 其他發布商
以下發布商也主機壓縮和未壓縮版本的jQuery版本。 jQuery 1.9開始他們也可能主機 sourcemap文件 ; 檢查網站的文檔。
請注意,可能會有延遲jQuery版本及其可用性之間。 請耐心等待,他們收到文件同時博客是公開。 β和候選版本不是由這些發布商。
鏈接 關於代碼
jQuery提供下 麻省理工學院的許可 。
托管代碼和開發的 jQuery GitHub庫 。 如果你發現了一些地區的可以改進的代碼,請在討論它 jQuery核心發展論壇 。 如果你想參與開發jQuery,我們細讀 貢獻者的網站 為更多的信息。
查找和下載jQuery插件開發的貢獻者,請訪問 插件的網站 。 插件作者負責維護他們的插件。 反饋插件應該針對插件作者,不是jQuery團隊。
鏈接 構建從Git
注意: 使用jQuery的最新工作版本,請上述jQuery預發布構建。
所有的源代碼保持Git版本控制下,你可以在網上瀏覽。 存儲庫的 自述 有更多的信息構建和測試自己的jQuery,以及指示創建一個自定義構建,排除了一些api來減少文件大小。
如果你訪問Git,你可以連接到存儲庫:
1
|
git克隆git:/ /github.com/jquery/jquery.git
|
你也可以看看,建立一個特定版本的jQuery從GitHub:
1
2
|
git clone git://github.com/jquery/jquery.git
git checkout 1.2.6
|
The README file for a specific version will have instructions for building that version, as the process has changed over time.
The README file for a specific version will have instructions for building that version, as the process has changed over time.
linkPast Releases
All past releases can be found on the jQuery CDN.