JSON-P with jQuery


/ Published in: JavaScript
Save to your folder(s)

Using JSON-P with jQuery. Note the callback.


Copy this code and paste it in your HTML
  1. $.getJSON("http://example.com/chats.json?callback=?", function(data){
  2. $.each(data.chats, function(i,chat){
  3. alert(chat.body);
  4. });
  5. });

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.