Created
June 25, 2012 02:11
-
-
Save creativepsyco/2986031 to your computer and use it in GitHub Desktop.
Sample usage of phonegap+imgur uploader.js
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
<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