Created
May 6, 2014 11:56
-
-
Save alexanderkustov/a2d72aa9e17d645e4ec1 to your computer and use it in GitHub Desktop.
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
| function editProfile(e) { | |
| var url = mainserver + "/users/"+Alloy.Globals.user_id+"/?format=json&auth_token=" + Alloy.Globals.auth_token ; | |
| var client = Ti.Network.createHTTPClient({ | |
| onload : function(e) { | |
| Ti.API.info("Received text: " + this.responseText); | |
| alert('Profile updated!'); | |
| }, | |
| onerror : function(e) { | |
| alert('Error updating profile: ' + e.code); | |
| console.log(e); | |
| }, | |
| timeout : 60 * 1000 | |
| }); | |
| var params = { | |
| 'name': $.name.value, | |
| 'email': $.email.value.toLowerCase(), | |
| 'short_description': $.short_description.value, | |
| 'password' : $.password.value , | |
| 'password_confirmation' : $.password_confirmation.value | |
| }; | |
| auth_token = null; | |
| client.open("PUT", url); | |
| client.send(params); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment