/ Published in: JavaScript
![](/img/icon_sav.png?v3)
Using JSON-P with jQuery. Note the callback.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$.getJSON("http://example.com/chats.json?callback=?", function(data){ $.each(data.chats, function(i,chat){ alert(chat.body); }); });
URL: http://actsasflinn.com/2008/06/13/cross-domain-restful-json-p-with-rails#jsonpwithjquery
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)