Problem consist of my lack of knowledge for Javascript afaik.
When I write:
function startOnDevice(){
var path = document.addEventListener("deviceready", onDeviceReady, true);
}
How can I then pass a “string” of what the name of the file should be? (ei. to onDeviceReady, and then further down the tree.
then after it has been passed to onDeviceReady. it needs to be passed to, onFSSuccess:
function onDeviceReady() {
//what do we have in cache already?
$("#status").html("Checking your local cache....");
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFSSuccess, null);
}
function onFSSuccess(fileSystem) {
fileSystem.root.getDirectory("dk.lector.html5Generic",{
create:true
},gotDir,onError);
}
and then onFSSuccess needs to give the value back to the variable path somehow.
Any help?
Ok, here’s a new version as you’ve updated the code in the question: