jQuery Loading Status for $.ajax

Posted by Geetha on Stack Overflow See other posts from Stack Overflow or by Geetha
Published on 2010-05-19T12:07:46Z Indexed on 2010/05/19 12:10 UTC
Read the original article Hit count: 178

Filed under:
|
|

Hi All,

I am using the following code to get data from the database( from cs page itself i am creating the html code) and binding the html code to the div.

Problem:

If the database size is higher it takes some time to show the result. thet time i want to shoe a loading.gif image in that location. Once it get the data i have to hide the load image.

Code:

    $.ajax({
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  data: "{ searchText: '" + searchText + "', product: '" + product + "', category: '" + category + "', artist:'" + artist + "'}",
                  url: "Search.aspx/FetchSearchResult",
                  dataType: "json",
                  success: function(data) { $("#searchContainer").html(data.d[0]);}});

Geetha.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about loading-image