1

我正在使用下面的代码,

navigator.camera.getPicture(failed, completed, { destinationType: Camera.DestinationType.DATA_URL });

function completed() {
    alert('got it');
}

function failed() {
    alert('Failed to get the photo');
}

它总是到达失败功能。我错过了任何许可吗?

4

1 回答 1

0

您正在将错误回调传递给成功,并将成功回调传递给错误。

你得到了正确的回调,但它调用了你提供的失败,

navigator.camera.getPicture(completed, failed, { destinationType: Camera.DestinationType.DATA_URL });   
于 2013-09-15T20:08:08.253 回答