Json Blogger Dengan Ajax Jquery - Dewa Blogger

Halaman

    Social Items

Buy Now

Json Blogger Dengan Ajax Jquery

HTML

<div id="result">Loading...</div>

jQuery

// $.ajax({url:feedUrl,type:'get',dataType:'jsonp',success:function(json){ … }}); $(function() {     $.ajax({         url: 'http://nama_blog.blogspot.com/feeds/posts/summary?alt=json-in-script',         type: 'get',         dataType: 'jsonp',         success: function(data) {             var link, title, skeleton = '',                 content = data.feed.entry;             if (content !== undefined) {                 skeleton = "<ol>";                 for (var i = 0; i < content.length; i++) {                     title = content[i].title.$t;                     for (var j = 0; j < content[i].link.length; j++) {                         if (content[i].link[j].rel == "alternate") {                             link = content[i].link[j].href;                             break;                         }                     }                     skeleton += '<li><a href="' + link + '">' + title + '</a></li>';                 }                 skeleton += '</ol>';                 $('#result').html(skeleton);             } else {                 $('#result').html('<span>No result!</span>');             }         },         error: function() {             $('#result').html('<strong>Error loading feed!</strong>');         }     }); });

Lihat Demo

Referensi: Blogger JSON Feed With jQuery Ajax


Sumber https://www.dte.web.id/