2013年10月22日火曜日

jQueryでAjaxを使ってJSONを扱うには

$.ajax({
    url: "someUrl",      // -----------------------> リクエストするURL
    dataType: "json",  // -----------------------> JSONがサーバーから返ってくる事を想定
    success: function(response) {
   // -----------------------> JSONをresponse.person.nameなどのような形で操作する
    }

});

0 件のコメント:

コメントを投稿