before send ajax loading

Solutions on MaxInterview for before send ajax loading by the best coders in the world

showing results for - "before send ajax loading"
Mats
22 Sep 2017
1$("#loading").ajaxStart(function(){
2   $(this).show();
3 });
4
5$("#loading").ajaxComplete(function(){
6   $(this).hide();
7 });
8
Michelle
23 Nov 2016
1$.ajax({
2   url : dle_root + 'engine/ajax/fast.php',
3   data: { text: response, action: action },
4   beforeSend: function(){
5     $("#loading").show();
6   },
7   complete: function(){
8     $("#loading").hide();
9   },
10   success:  function (data) {
11        if (data == 'ok') {
12            DLEalert(dle_p_send_ok, dle_info);
13        }
14        else { DLEalert(data, dle_info); }
15    });
16 });
17