var Model= function() {
function GetData() {
// Sending the request and i am getting the response.
JsonClientScheduleCareProvider.onload = function() {
return this.responseText;
};
// error handling
JsonClientScheduleCareProvider.onerror = function (e) {
};
return {
GetApps: GetData,
}
}();
Dans le code ci-dessous, je fais mon appel JSON. Si j'obtiens la réponse, je devrais appeler la fonction sendData
avec la réponse.Fonction de rappel dans la réponse JSON
var jsonData = Model.GetApps();
if (!jsonData) {
Ti.API.warn("JsonData");
SendData(jsonData);
}
Le problème que je suis confronté est avant la jsonData
me reçoit la réponse, le SendData
est appelé. Je dois exécuter la fonction SendData seulement quand j'obtiens la réponse.
Ceci et l'OP semblent manquer un ''}. –
@MattFenwick Merci. Déjà mis à jour. – Engineer