I have the following function
function fileExists(FileName) {
var retvar="false";
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
fileSystem.root.getFile(FileName, null,
function() {
fileEntry.file(function() {
alert("Exists");
},
function() {
});
},
function () {
retvar = "true";
alert(retvar); //says true
});
},null);
alert(retvar); //says false
}
here, i have to set the value of retvar as true in the inner nested function. I can't pass that value outside that function. Could any one tell me any idea for passing that value to the parent function?
"true"and"false"asStrings for a specific reason? Wouldn't it be better to usetrueandfalsedirectly asbooleans?alert("inner value : " + retvar);andalert("outer value : " + retvar);the inner alert is executing first