When i write file, File created successfully, but next time when i read same file and move to other html file (using location.href=’filename.html’) it show following error:
JSCallback Error: Request failed.
Additional Detail:
I have created one function to check files are present in sdcard or not . If file is present in sdcard then it reads the content of file and navigate to html file in read method of phoneGap else it creates new file, write data in that file using phonegap write method and navigate to html.
In read method when i navigate to that html file and again call function to check file exists or not on onload event it call
“document.addEventListener(“deviceready”, onDeviceReady, false);” only never go ahead and
“JSCallback Error: Request failed.” this error is display on log.
My guess is this is an issue asynchronous function call. The js calls to phonegap apis are asyncchronous and you need to wait till your callback gets called to open the file