Created
November 15, 2013 21:15
-
-
Save mdix/7491762 to your computer and use it in GitHub Desktop.
No anon fct as param
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 whenSuccessful = function (data) { | |
user = data.data; | |
// Fill display data | |
updateDisplayData(user); | |
// Fill form data (initially hidden) | |
updateFormWithJson(user); | |
}; | |
var whenFail = function (data) { | |
throw new Error('json request failed: ' + data.statusText); | |
}; | |
var request = $.ajax(configuration).done(whenSuccessful).fail(whenFail); | |
requests.push(request); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment