Page 1 of 1

Asynchronous REST Service call in JS

Posted: Thu Apr 03, 2014 7:06 pm
by mehtashail

Is it possible to make an asynchronous call to a REST Service in Javascript. I have a snippet as follows but I dont want myService.execute to be triggered asynchronously.

code
var nextPage = localStorage.getItem('nextPage');
if(typeof nextPage !== 'undefined') {
localStorage.removeItem('nextPage');
myService.execute({});
Appery.navigateTo(nextPage, {transition: 'slideup', reverse: false});
}
else {
alert('Local Storage is not set');
}

/code


Asynchronous REST Service call in JS

Posted: Thu Apr 03, 2014 7:52 pm
by Maryna Brodina

Hello!

Services are not sync. If you need to do some actions after service was invoked, use success, fail, complete service events.


Asynchronous REST Service call in JS

Posted: Sun Apr 06, 2014 12:17 am
by mehtashail

Maryna
It seems somewhat flaky on Android. Works beautifully on ios. Do you have any reports of that?
thanks
shail


Asynchronous REST Service call in JS

Posted: Sun Apr 06, 2014 6:32 pm
by Maryna Brodina

Hello!

Could you clarify what do you mean on "flaky"? What exactly doesn't work?