Kali ini akan dicoba mengekstarak rss feed dari tokoone.com :
<div id="result">hasil</div>
<script>
$(function(){
var url='http://tokoone.com/feed';
$.ajax({
type: "GET",
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),
dataType: 'json',
error: function(){
alert('Unable to load feed, Incorrect path or invalid feed');
},
success: function(data){
$.each(data.responseData.feed.entries, function(i,data){
$("#result").append(data.title+"<br/>"+data.contentSnippet+"<br/><br/>");
});
}
});
});
</script>
Smoga bermanfaat....!
ConversionConversion EmoticonEmoticon