Skip to content

Instantly share code, notes, and snippets.

@jjulian
Forked from scottmessinger/WTF.js
Created February 21, 2011 11:09
Show Gist options
  • Save jjulian/836934 to your computer and use it in GitHub Desktop.
Save jjulian/836934 to your computer and use it in GitHub Desktop.
Helping Scott M with $.ajax
// We all overlooked the fact that there was no "callback" for the response
// Ajax is asynchronous
$.ajax({
url : '/plans.json',
success: function(json, status, xhr) {
console.log("request is complete");
console.log(json[0].plan.created_at);
}
});
console.log("request is still running");
// See http://api.jquery.com/jQuery.ajax/ for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment