<!DOCTYPE HTML> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> <title></title> <script> $("#index").live("pagecreate",function(){ var api = "http://vesta-tmp.sakura.ne.jp/xml-jsonp.php?xml=headlines.yahoo.co.jp/rss/rps_dom.xml&callback=?"; $.getJSON(api,function(data){ $("#index ul").html(""); $.each(data.channel.item, function(i,item){ $("#index ul").append("<li><a href=\"" + item.link + "\" data-role=\"button\" rel=\"external\"><h2>" + item.title + "</h2><p>" + item.category + "</p><p>" + item.pubDate + "</p></a></li>").listview('refresh'); }); }); }); $("#index > *").live("swipeleft",function(){ $.mobile.changePage('#second',{reverse:false,transition:"slide"}); }); $("#second").live("pagecreate",function(){ var api = "http://vesta-tmp.sakura.ne.jp/xml-jsonp.php?xml=rss.dailynews.yahoo.co.jp/fc/domestic/rss.xml&callback=?"; $.getJSON(api,function(data){ $("#second ul").html(""); $.each(data.channel.item, function(i,item){ $("#second ul").append("<li><a href=\"" + item.link + "\" data-role=\"button\" rel=\"external\"><h2>" + item.title + "</h2><p>" + item.category + "</p><p>" + item.pubDate + "</p></a></li>").listview('refresh') }); }); }); $("#second > * ").live("swiperight",function(){ $.mobile.changePage('#index',{reverse:true,transition:"slide"}); }); </script> <title></title> </head> <body> <div data-role="page" id="index"> <div data-role="header"> <h1>RSSの取得</h1> </div> <div data-role="content"> <h2>Yahooニュース(トピックストップ)</h2> <ul data-role="listview" data-inset="true"></ul> </div> <div data-role="footer"> <h4>Yohsuke Nakano</h4> </div> </div> <div data-role="page" id="second"> <div data-role="header"> <h1>RSSの取得</h1> </div> <div data-role="content"> <h2>Yahooニュース(国内)</h2> <ul data-role="listview" data-inset="true"></ul> </div> <div data-role="footer"> <h4>Yohsuke Nakano</h4> </div> </div> </body> </html>