mehtashail
Posts: 0
Joined: Tue Feb 04, 2014 1:29 am

Asynchronous REST Service call in JS

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Asynchronous REST Service call in JS

Hello!

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

mehtashail
Posts: 0
Joined: Tue Feb 04, 2014 1:29 am

Asynchronous REST Service call in JS

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Asynchronous REST Service call in JS

Hello!

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

Return to “Issues”