由于我在 Android/iO 中调试应用程序时遇到了真正的麻烦,有人可以告诉我一些简单的测试来检查 Cordova 文件 API 是否已加载并正常工作吗?
类似于:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if(fileAPI){ // what can I test there ?
alert('File API is OK');
}
}
最佳答案
尝试请求文件系统
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
alert("it works");
}, function (e) {
alert("it doesn't work");
});
关于android - Cordova : How to check if File API works?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24078380/