I have a Cordova/PhoneGap application where I create directories on the phone persistent storage. I have a problem passing the context to the Cordova plugin API. I use the DirectoryEntry.getDirectory() method who receives two callbacks - one for success and the second is for error. The success method signature is function success(dirEntry) { ... }
, where I want to use it like this:
var x = // some data collected
rootdor.getDirectory("mydir", {create: true, exclusive: false}, success, fail);
// store x in the retrieved/created directory, can be done in the success method
I need help with the last part - how do I pass reference to x
in the success callback.