Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created April 24, 2014 13:57
document.querySelector("#camera").addEventListener('touchend', function() {
navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
destinationType: Camera.DestinationType.DATA_URL
});
function onSuccess(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}
function onFail(message) {
alert('Failed because: ' + message);
}
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment