show spinner during api request pure html and jquery

Solutions on MaxInterview for show spinner during api request pure html and jquery by the best coders in the world

showing results for - "show spinner during api request pure html and jquery"
Marta
23 Jun 2020
1var $loading = $('#loadingDiv').hide();
2$(document)
3  .ajaxStart(function () {
4    $loading.show();
5  })
6  .ajaxStop(function () {
7    $loading.hide();
8  });
9
Alyssia
27 May 2016
1$('#loadingDiv')
2    .hide()  // Hide it initially
3    .ajaxStart(function() {
4        $(this).show();
5    })
6    .ajaxStop(function() {
7        $(this).hide();
8    })
9;
10