Posted By

1man on 12/26/08


Tagged

javascript jquery json callback


Versions (?)

JSON-P with jQuery


 / Published in: JavaScript
 

URL: http://actsasflinn.com/2008/06/13/cross-domain-restful-json-p-with-rails#jsonpwithjquery

Using JSON-P with jQuery. Note the callback.

  1. $.getJSON("http://example.com/chats.json?callback=?", function(data){
  2. $.each(data.chats, function(i,chat){
  3. alert(chat.body);
  4. });
  5. });

Report this snippet  

You need to login to post a comment.