Created
November 15, 2013 21:22
-
-
Save mdix/7491860 to your computer and use it in GitHub Desktop.
2
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
var setUserProfileValuesFromJson = function () { | |
var configuration = { | |
url: dataUrl, | |
type: 'GET', | |
dataType: 'json' | |
}; | |
var handleData = function (data) { | |
user = data.data; | |
// Fill display data | |
updateDisplayData(user); | |
// Fill form data (initially hidden) | |
updateFormWithJson(user); | |
}; | |
var handleFailure = function (data) { | |
throw new Error('json request failed: ' + data.statusText); | |
}; | |
var request = $.ajax(configuration).done(handleData).fail(handleFailure); | |
requests.push(request); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment