Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created March 2, 2011 01:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vinibaggio/850289 to your computer and use it in GitHub Desktop.
Save vinibaggio/850289 to your computer and use it in GitHub Desktop.
Api do call 4 paperz
# Index
http://www.call4paperz.com/events.json
# Show do evento
http://www.call4paperz.com/events/1.json
# Show da proposta
http://www.call4paperz.com/events/1/proposals/1.json
# Evento com JSONP (preste atenção no p no formato)
http://www.call4paperz.com/events/1.jsonp?callback=meu_callback
@cmilfont
Copy link

cmilfont commented Mar 3, 2011

//Como consumir via JSONP do Jquery -- testado no Firebug e Firefox 3.6 com jquery 1.5

var callback = function(data) {
  var event = data.event
  console.log(event);
  event.proposals.forEach(function(proposal){
      console.log(proposal);
  });
}

var url = "http://call4paperz.com/events/13.jsonp";
var config = {dataType: "jsonp", jsonpCallback: "callback"};
$.ajax(url, config);

@vinibaggio
Copy link
Author

Show! Valeu :D

@cmilfont
Copy link

cmilfont commented Mar 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment