-
-
Save jjulian/836934 to your computer and use it in GitHub Desktop.
Helping Scott M with $.ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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