Warning: Undefined array key 0 in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 406

Warning: Attempt to read property "parent" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 407

Warning: Attempt to read property "term_id" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413

Warning: Attempt to read property "cat_name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413

jQueryライブラリを読み込む


Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517

Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517

Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517

Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517
jquery

jQueryは便利な機能の詰まったライブラリなので、そのライブラリを読み込まなければ機能が利用できません。 ライブラリはネット上に公開されているものを利用する方法と、ローカルに落として利用する方法があります。

ネット上にコンテンツを公開する仕組みをCDN(Contents Delivery Network)と言います。 これはファイルや画像などのコンテンツをインターネット上で最適なやり取りをするためのネットワークです。 サーバが世界中に分散しているのでダウンする心配もほぼないですし、一番近くのサーバから持ってきてくれるため遅延も少ないです。

以下にjQueryの読み込み方法をいくつか書きます。お勧めはGoogleCDNの利用で、ローカル環境でもない限りはこれでいいと思います。

ローカルにjQueryをダウンロードして使う方法

jQuery.comのダウンロードページで公開されているファイルからダウンロードし、任意のフォルダに格納してスクリプトタグで宣言します。


書いておいて何ですが、イントラネットやテスト環境などのインターネット非接続環境でもない限りはローカルのものを使いません。 頻繁にバージョンが更新されるため、その都度ダウンロードしなおす手間がかかってしまいますし容量も無駄です。

CDNを読み込む方法

scriptタグを使ってCDNを読み込むことも可能です。「9.99.9」の部分はバージョン情報ですので、書き換えて使用してください。 使用するバージョンの選定は以下のページで確認しましょう。

バージョンが更新された場合は数字を書き換えましょう。 セキュリティの問題もありますので、なるべく最新版を使うのが好ましいです。

jQueryのCDNを使う


GoogleのCDNを使う←おすすめ


MicrosoftのCDNを使う



Warning: Undefined variable $category in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 79

Warning: Attempt to read property "name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 79

の記事

eyecatch

WordPressの更新通知を消す方法

eyecatch

jQueryとは

eyecatch

PCサイトとスマホサイトの違い

eyecatch

定数の宣言と命名規約

eyecatch

ドロップシャドウでテキストやボックスに影を付ける

eyecatch

HTMLの歴史


Warning: Undefined variable $category in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 84

Warning: Attempt to read property "count" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 84
HOME