jQuery Ajax Sample - 外部RSSなどからデータを得る

STUDIO KEYのWordPressブログデータを得る

jQuery

  $(function() {
    $.ajax({
      url: "proxy.php",
      dataType: "xml"
      }).done(function(xml){
        $("#blog").html(''); //ローダーを消す
        $(xml).find("item").each(function(){
          var title = $(this).find("title").text();
          $('#blog').append(title+'
'); }); }).fail(function(xml){ $("#blog").html('取得に失敗しました'); }); });

proxy.php

  echo file_get_contents('http://studio-key.com/feed');