php - jquery post Showing loading message till success -


i have following script fetch data server based on form parameters.

 jquery('#request_search').submit(function(e){      e.preventdefault();            var s_date=jquery('#actualfrom').val();         var e_date=jquery('#actualto').val();         var type=jquery("#type").val();         var loc=jquery("#loc").val();     jquery.post("scripts/get_gamma_activity_type.php", {"loc":loc,"start_date":s_date, "end_date":e_date, "type":type},  function(data) {    jquery('#report').html(data);});            });    }); 

this part working , times, based on search criteria , takes couple of seconds results. in mean time show gif saying data loading. have gif ready. how implement in above script?

please try this.

jquery('#request_search').submit(function(e){         $("#report").html("<div><img src='loading.gif' alt='loading.. \n please wait' title='loading.. \n please wait'` /></div>");      e.preventdefault();            var s_date=jquery('#actualfrom').val();         var e_date=jquery('#actualto').val();         var type=jquery("#type").val();         var loc=jquery("#loc").val();     jquery.post("scripts/get_gamma_activity_type.php", {"loc":loc,"start_date":s_date, "end_date":e_date, "type":type},  function(data) {    jquery('#report').html(data);});          }); });    

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -