0

Where I make mistakes? I would like to see image after save button click. I see only white screen without returned image. I am using Android and Galaxy S device.

$(function(){       

    document.addEventListener("deviceready", phonegapLoaded, false);

    function phonegapLoaded(){

    }

    $("#vyfotit").click(function(){

            navigator.camera.getPicture(onSuccess, onError, {quality: 70, destinationType: Camera.DestinationType.FILE_URI});                       

        });

    function onSuccess(imageURI){

        var image = document.getElementById("image");

        image.src = imageURI;

        image.style.display = block;

        }

    function onError(message){

        navigator.notification.alert("Failed because: " + message);

    }    
});
4

2 回答 2

0

在 AndroidManifest.xml 中包含访问相机的权限

于 2012-06-05T19:58:06.657 回答
0

是否有带有 id 图像的元素?我看到这不起作用的唯一原因是该元素在 DOM 中不存在。

于 2012-06-06T03:59:41.473 回答