Created
July 7, 2009 14:51
-
-
Save kwhinnery/142118 to your computer and use it in GitHub Desktop.
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
//Make XHR request to post picture | |
function postPic(pic) { | |
var query = 'https://twitpic.com/api/uploadAndPost'; | |
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onreadystatechange = function() { | |
if (this.readyState == 4) { | |
notify('Picture posted sucessfully!'); | |
} | |
}; | |
xhr.open('POST',query); | |
xhr.send({ | |
media:pic, | |
username: $("#username").val(), | |
password: $("#password").val(), | |
message: $("#message").val() | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment