Created
February 21, 2011 02:08
-
-
Save scottmessinger/836575 to your computer and use it in GitHub Desktop.
I don't understand.
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
// This doesn't work: | |
> var data = $.ajax({ url : '/plans.json'}).responseText | |
> undefined | |
// However, if I set data then ask for the responseText, it does. I don't understand why this happens, but I accept it. | |
> var data = $.ajax({ url : '/plans.json'}) | |
> undefined | |
> data.responseText | |
> "[{"plan":{"created_at":"2011-02-21T00:36:29Z","id":1,"updated_at":"2011-02-21T00:36:29Z"}},{"plan":{"created_at":"2011-02- etc etc...... | |
// However, I don't understand why the following the following code doesn't work at all. | |
> var d = $.ajax({ url : '/plans.json'}) | |
var data = d.responseText | |
console.log(d) | |
console.log(d.responseText) | |
console.log(data) | |
> Object | |
undefined | |
undefined | |
undefined | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment