function removefile(){ fileSystem.root.getfile("readme.txt",{create: false,exclusive: false},gotRemovefileEntry,fail); } function gotRemovefileEntry(fileEntry){ console.log(fileEntry); fileEntry.file(gotfile,fail); entry.remove(success,fail); } function success(entry) { console.log("Removal succeeded"); } function fail(error) { console.log("Error removing file: " + error.code); }
我用HTML调用它;
<button onclick="removefile();">remove file</button>
代码有问题吗?我看不到它.
顺便说一句,我正在为iOS编写代码,并在Xcode中使用JavaScript,HTML和PhoneGap / Cordova.
我是iPhone开发的新手,所以任何帮助都会很棒,非常感谢:)
解决方法 你的代码略有偏差.尝试:function removefile(){ fileSystem.root.getfile("readme.txt",fail);}function gotRemovefileEntry(fileEntry){ console.log(fileEntry); fileEntry.remove(success,fail);}function success(entry) { console.log("Removal succeeded");}function fail(error) { console.log("Error removing file: " + error.code);}总结
以上是内存溢出为你收集整理的javascript – PhoneGap文件删除无法正常工作全部内容,希望文章能够帮你解决javascript – PhoneGap文件删除无法正常工作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)