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

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -