Skip to content

Instantly share code, notes, and snippets.

@creativepsyco
Created June 25, 2012 02:11
Show Gist options
  • Save creativepsyco/2986031 to your computer and use it in GitHub Desktop.
Save creativepsyco/2986031 to your computer and use it in GitHub Desktop.
Sample usage of phonegap+imgur uploader.js
<script type="text/javascript">
var pic_callback = function(image_data, message) {
if(message.length>1) {alert("Image selected ");}
var upload_callback = function(url, msg) {
if(url == null || url== undefined || url.length<1) {
alert("Failed to upload" + msg);
} else {
alert("Img Url " + url)
}
};
Upload.upload(image_data, upload_callback);
}
</script>
<a href="#" onclick="Upload.getPhotoFromLibrary(pic_callback)">Select and upload Photo</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment