JSON.parse Not Working In PhoneGap
I'm working on a program that needs to save user data in a file as a JSON format. It is doing fine saving my data as JSON but when I try to use JSON.parse to parse my stored JSON i
Solution 1:
the readUser does not return anything. the content of the file is available in the readAsText callback. you have to json parse the evt.target.result and continue from there.
Solution 2:
For reading use:
jsonVariable = jQuery.parseJSON(evt.target.result);
For writing use:
writer.write(JSON.stringify(propFileJson));
Post a Comment for "JSON.parse Not Working In PhoneGap"