Created
December 23, 2011 20:29
-
-
Save notbenh/1515279 to your computer and use it in GitHub Desktop.
Attempting to use ajax return object to modify current object
This file contains hidden or 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
Thing.user = new Object; | |
Thing.user.new = function(user){this.user = user; return this}; | |
Thing.user._fetch_user_data = function(){ | |
$.ajax({ url: '/api/' + this.user | |
, dataType: 'json' | |
, async:false | |
, success: function(data){ console.info(data); for(key in data) this.$key = data[key]; } | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment