Html部分
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Generator" content="EditPlus" /> <meta name="Author" content="80aj" /> <meta name="Keywords" content="" /> <meta name="Description" content="" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> <script type="text/javascript" src="http://jquery-xml2json-plugin.googlecode.com/svn/trunk/jquery.xml2json.js"> </script> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $.ajax({ url: 'rs.php', type: 'GET', dataType: 'xml', error: function(xml) { alert('请求出错'+xml); }, success: function(xml) { var rss = $.xml2json(xml); $.each(rss.entry, function(i, entry){ $("#test-rss").append( entry.content+' ' ); }); } }); }); // ]]> </script> Rss订阅地址:http://itunes.apple.com/rss/generator/?cc=CN Rss订阅详细内容:http://itunes.apple.com/cn/rss/topgrossingapplications/limit=10/xml 苹果中国地区销量Top10排行榜
Php部分
/*
Description: demo
Version: 0.0.1
Author: 80aj
Author URI: http://www.80aj.com/
Emial:a@80app.com
*/
$xmlurl = "http://itunes.apple.com/cn/rss/topgrossingapplications/limit=10/xml";
header('Content-type:application/xml');
$fp = file_get_contents($xmlurl) or die("can not open $xmlurl");
echo $fp;
?>
不错,现在还可以用