2014年4月29日 星期二

透過JQuery取得Rss資料

參考連結:
使用案例:
<script src='http://code.jquery.com/jquery-1.10.2.js'></script>
<script src="http://sdepold.github.io/jquery-rss/src/jquery.rss.js"></script>
<script>
jQuery(function ($) {
$("#rss-styled").rss("http://kylesheng.blogspot.com/feeds/posts/default?alt=rss", {
limit: 4,
layoutTemplate: '<ul>{entries}</ul>',
entryTemplate: '<li><a href="{url}">{title}</a> <span class="news-date">{date}</span><br>{shortBodyPlain}</li>'
}).show();
})
</script><div id='rss-styled'></div>
DEMO: