[jQuery] Google Hosted Libraries を利用してjQueryを使えるようにする

jQueryを使う場合、jQueryのファイルをサーバーに設置して使う方法がありますが、Google Hosted Libraries を使えばリンクを記載するだけでjQueryを使うことができてしまいます。
ものの1分程度でJQuery環境が手に入ってしまいます。
jQuery だけではなく、jQuery UI , jQuery Mobile , Prototype , AngularJS などもリンクを貼るだけで使えるようになっています。
Contents
利用方法
jQuery
Google Developers Hosted Librariesのページに利用方法が記載してあります。
1 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |
上記のURLの2.1.4という数字の部分は jQuery のバージョンになっています。
2015年7月末日の時点で使えるバージョンは
1 |
2.1.4, 2.1.3, 2.1.1, 2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.11.3, 1.11.2, 1.11.1, 1.11.0, 1.10.2, 1.10.1, 1.10.0, 1.9.1, 1.9.0, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.2, 1.7.1, 1.7.0, 1.6.4, 1.6.3, 1.6.2, 1.6.1, 1.6.0, 1.5.2, 1.5.1, 1.5.0, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.2, 1.3.1, 1.3.0, 1.2.6, 1.2.3 |
となっています。
jQuery UI
1 2 |
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> |
バージョン
1 |
1.11.4, 1.11.3, 1.11.2, 1.11.1, 1.11.0, 1.10.4, 1.10.3, 1.10.2, 1.10.1, 1.10.0, 1.9.2, 1.9.1, 1.9.0, 1.8.24, 1.8.23, 1.8.22, 1.8.21, 1.8.20, 1.8.19, 1.8.18, 1.8.17, 1.8.16, 1.8.15, 1.8.14, 1.8.13, 1.8.12, 1.8.11, 1.8.10, 1.8.9, 1.8.8, 1.8.7, 1.8.6, 1.8.5, 1.8.4, 1.8.2, 1.8.1, 1.8.0, 1.7.3, 1.7.2, 1.7.1, 1.7.0, 1.6.0, 1.5.3, 1.5.2 |
関連記事
- [JQuery] Datepickerで日付をカレンダー形式で簡単に入力する方法
- [JQuery] Ajaxが使える状態かどうかチェックする方法
- [jQuery] WordPressでJQueryが動かない場合の対処方法
- [jQuery] エラー: uncaught referenceerror $ is not defined の対処方法
- [Bootstrap] Modal dialog(モーダル・ダイアログ)の使い方