0

I am using jQuery UI tabs in my page. When one tab is clicked an ajax call goes on and content is prepared and displayed. Ajax call and content preparation takes 5-6 second.

When I click on tab my screen remain idle after 6 second the tab content is shown. But I want to show loading message. How to do it?

halfer
  • 19,824
  • 17
  • 99
  • 186
santosh
  • 61
  • 1
  • 1
  • 4

2 Answers2

0

jQuery has global AJAX handlers that it will call during the processing of an AJAX request. On the ajaxStart handler you could unhide a progress GIF and on the ajaxComplete handler hide it.

$(document)
    .ajaxStart(function() {
        // Show GIF
    })
    .ajaxComplete(function() {
        // Hide GIF
    });
Jay Pondy
  • 176
  • 2
  • 11
0

I just made the ajax call Async: true and placed a loading message as content before ajax call. And its working fine for me..

Thank you all for your responses

santosh
  • 61
  • 1
  • 1
  • 4