2013年12月24日火曜日

超初心者のためのjQuery入門

こんにちは、B3のkoyutaです。
いよいよクリスマスイブですね。ちなみにクリスマスイブの「イブ」はイブニングという意味なのです。
つまり本当のクリスマスイブとは12月25日の夕方のことなのですね。

それはさておき、今回は僕のような超初心者のためにjQueryの「導入方法」と「HelloWorldの表示」の紹介をします。

jQueryとは何ぞ
javascriptでよく使われている機能を簡単に書くことができるようにしたライブラリです。難しい処理も数行で済むようになるのはめんどくさくなくてうれしいですね。

入れ方
公式サイトからjQueryをダウンロードします。なんだかバーションがいっぱいありますが、とりあえず対象とするブラウザにあったやつを入れてください。とりあえず僕は「compressed, production jQuery 2.0.3」を入れました。

HelloWorldを表示させる
jQueryは<head>などで読み込みます。
<html>
<head>
    <meta charset="UTF-8">
    <title>jQuery使ってみる</title>
    <script src="./jquery-2.0.3.min.js"></script>
    <script>
        $(function(){
            $("#str").html("Hello World")
        });
    </script>
</head>
<body>
    <div id="str"></div>
</body>
</html>
はいこれだけです。strというidのdiv要素の中身を変更しているだけです。

HelloWorldの表示では今ひとつjQueryの使う必要なんてなくね?と思ってしまいますね...
jQueryの本当の便利な部分は、プラグインをダウンロードするだけで初心者でもある程度きれいなWebサイトが作れてしまうところ...だと思います。

今回は紹介できませんでしたがjQueryには他にもたくさんのプラグインがあります。興味あるかも!という方はぜひ調べてみてください。

7 件のコメント:

  1. You have taken the great initiative of teaching jQuery but I would suggest you to make the video lectures and don't forget to transcribe your videos with the best academic transcription writing services.

    返信削除
  2. 토토사이트
    토토


    I have read a few good stuff here. Definitely value bookmarking for revisiting.

    返信削除
  3. 토토사이트
    토토

    Hi there, I enjoy reading all of your post. I wanted to write a little comment to support you.


    返信削除
  4. 바카라사이트
    바카라

    These are in fact impressive ideas in on the topic of blogging.
    You have touched some nice things here.

    返信削除
  5. thats great You've done a tremendous step by teaching jQuery, but I would recommend that you create video lessons and don't forget to transcribe your videos; it's a good concept, in my opinion. I am awordpress development services who offers web design bolt services. This post definitely made my day. You have no idea how long I spent seeking for this information! thanks

    返信削除
  6. 30% off your purchase plus free delivery with this vonhaus discount code Knock 30% off bestselling furniture, tools, outdoor essentials, homewares, and more .

    返信削除
  7. Reading all of your posts is enjoyable. I wanted to leave a little note in support of you. google

    返信削除