<div class="contents">aaaa</div>
こういうタグをjqueryで呼び出すとき
『class名がcontestsである』という意味で
$('div[class="contents"]')
ですが
<div class="contents clearFix">aaaa</div>
だとclass名はcontestsではなくなってしまうので
$('div[class*="contents"]')
という風に『class名にcontestsを含む』
という記述に変えなくてはなりません

気づくのに2時間、、、


日々精進です。


//ロードやクリックなどで
$.ajax({
url: 'hogehoge.xml',
type: 'GET',
cache:false,
dataType:'xml',
error: function(){cant_connect();},
success: function(xml){connected(xml);}
});
//エラー処理
function cant_connect() {
alert('サーバーと接続できませんでした');
}

//成功時
function connected(xml) {
$(xml).find("item").each(function(idx){
//それぞれの処理
$("#thumbnailList").append(
         '
  • +'" alt="
    +$(this).find("title").text()
    +'/>

  • ')
    });



    xmlの中身、、

    aaaimgURL0URL0
    bbbimgURL1URL1
    cccimgURL2URL2




    preタグがうまく使えない、、、
    中途半端ですいません。

    typeof演算子は、パラメータに指定した値が何であるかを文字列で返すものです。


    typeof(123)
    ・・・number
    typeof("ABC")
    ・・・string
    typeof("encodeURI")
    ・・・function
    typeof(true)
    ・・・boolean
    typeof(document)
    ・・・object
    typeof(aaaaa)
    ・・・undefined


    だそうです、引数チェックに使えますね。