Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading indicator with Google Chrome

I have problem with Google Chrome or rather Androids (2.1) webbrowser.

My webapp calls restservices with each page shift. This takes some time and I need a feedback for the user like a little "working..." popup . The restservices are called with a sync ajax request. Here is an example:

$.ajax({
    url: some URI,
    async: false,
    beforeSend: function() {
        showIndicatorDialog();
    },
    complete: function() {
        hideIndicatorDialog();
    },
    success: function(response) {
        do something after success;
    },
    error: function(response) {
        do something after error;
    },
    type: 'GET'
});

That works great on FF and Opera! But when I visit my webapp on Chrome oder with my Android device the loading indicator doesnt appears! It seems that the Google browser don't work with synchrchronous requests.

Does someone know how I can get this to work or knows another solution to get a loading indicator in chrome??

like image 606
bedit Avatar asked Jul 26 '10 15:07

bedit


1 Answers

The solution is not to use synchronous requests. In general, synchronous requests should never be used because they tend to block the execution of anything else on the page (or even the entire browser UI), which isn't good.

like image 63
Matti Virkkunen Avatar answered Sep 19 '22 12:09

Matti Virkkunen