我正在尝试在#smallImage中显示图像。
function onSuccess(imageData) {
var smallImage = document.getElementById('smallImage');
smallImage.style.display = 'block';
smallImage.src = "data:image/jpeg;base64," + imageData;
}
function capturePhotoWithData() {
var options = {
quality: 50
};
navigator.camera.getPicture(onSuccess, onFail, options);
}
function onFail(message) {
alert('Failed because: ' + message);
}
alert(imageData)向我显示图像的tmp文件路径。
<img style="display:none;" id="smallImage" src="" />
不显示图像。这里出了什么问题?