(function($) { $(function() { var home_url = $('#home_url').val(); // 最新ニュース取得 $.ajax({ url: home_url + 'wp-content/latest_news.json', dataType: 'json', success: function (data) { var items = data.items, html = [], item; for (var i = 0, length = items.length; i < length; i++) { item = items[i]; html.push([ '
' + item.published + '
', '
', '

' + item.title + '

', '

詳細を見る>

', '
' ].join('')); } $('section.news_headline .news_list dl').html(html.join('')); } }); // バナー取得 $.ajax({ url: home_url + 'wp-content/banner.json', dataType: 'json', success: function (data) { var items = data.items, html = [], item; for (var i = 0, length = items.length; i < length; i++) { item = items[i]; html.push([ '' ].join('')); } $('section.banner').html(html.join('')); } }); }); })(jQuery);