问题描述
我一直在试图运行以下code,但回调[确定()和高()不叫。结果
使用工作灯6.2(3.4科尔多瓦)。
I've been trying to run the following code but the callbacks [ok() and ko()] are not called.
Using Worklight 6.2 (Cordova 3.4).
function wlCommonInit() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
success, fail);
window.resolveLocalFileSystemURL(cordova.file.applicationDirectory
+ "www/index.html", ok, ko);
}
function ko(e) {
alert("NO");
}
function ok(fileEntry) {
alert("OK");
}
在另一方面 requestFileSystem
回调定期调用。
On the other hand requestFileSystem
callbacks are called regularly.
推荐答案
在问题上的code段不会在Android中因科尔多瓦缺陷工作:的。
The code snippet in the question will not work in Android due to a Cordova defect: https://issues.apache.org/jira/browse/CB-7273.
要取得进一步进展,这将有助于了解你有什么计划文件本身。
To progress further, it would help to understand what are your plans for the file itself.
- 请您只是想将文件路径
- 或你想要改变文件的内容?
- 或者
您可以在这个问题/答案阅读更多有关在科尔多瓦文件系统操作:Where确实LocalFileSystem.PERSISTENT点?
You can read more about file system operations in Cordova in this question/answer: Where does LocalFileSystem.PERSISTENT point to?
这篇关于科尔多瓦resolveLocalFileSystemURL回调没有被解雇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!