-1
我已经阅读了有关如何创建和存储文件的cordova文档https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#read-a-file-,但我似乎找不到在www /目录中读取或写入文件的方式。Cordova - 写入www目录中的json文件
嗯,我可以通过使用ajax调用来读取文件,但我不能写信给它,有没有办法做到这一点?
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs){
console.log(fs);
fs.root.getFile("www/json/instalation.json", {create: false, exclusive: false }, function (fileEntry) {
console.log("fileEntry is file?" + fileEntry.isFile.toString()); }, function(){console.log('error');});
}, function(){});
感谢