I have a couple of functions in Javascript / Jquery where I am passing a property to one function in turn passes down to another function.
The problem that I am getting is that the property in the first function has been populated but the second function the property is underfined.
ExecuteSQL: function (sql, onSuccess) {
try {
if (this.Database != null) {
this.Database.transaction(function (tx) {
tx.executeSql(sql, [], function (d, r) {
if (this.onSuccess) this.onSuccess(r);
});
});
}
else {
alert("Could not execute SQL, the database connection is closed.");
}
}
catch (e) {
alert("Failed to execute SQL," + e);
}
},
The onSuccess is a value at the ExecuteSQL scope but empty in the transaction scope.
Any help would be great.
Thanks Paul.