/ Published in: jQuery
Very simple example of pulling in a JSON feed from Yahoo pipes using jQuery.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery(function($){ //The yahoo pipe url (callback can be in the url, just pointing it out) var pipeURL = "http://pipes.yahoo.com/pipes/pipe.run?_id=00000000000000000000000&_render=json" + "&_callback=?"; var feedSuccess = function(date, status){ //Do something with it var html = "<ul>"; $.each(data.value.items, function(i,item){ html += "<li>" + item.title + "</li>"; }); html += "</ul>"; //Add the feed to the page $("#insertFeed").empty().append(html); }; /** * Make the ajax call. You can also use $.getJSON. */ $.ajax({ dataType: "json", url: pipeURL, success: feedSuccess, timeout: 4000 }); });