I have weird problem that I cant figure it out. I've made mobile app with jQuery and Phonegap. In my app I am calling some web-services to get data and when I do that it takes a few seconds so I want to show to user a loading bar. I have written my own loading presentation with .gif picture which I add to screen with javascript before service request. My problem is that this .gif is not added to screen until web service function is almost half or completely through. Like I would call it asynchronously, but as far as know It is all on one thread. So how could I achieve this?
(pseudo code)
showLoading();
callWebService();
stopLoading();