Answers for "how to use loading spinner in html using javascript fetching api"

1

show spinner during API request pure html and jquery

var $loading = $('#loadingDiv').hide();
$(document)
  .ajaxStart(function () {
    $loading.show();
  })
  .ajaxStop(function () {
    $loading.hide();
  });
Posted by: Guest on December-01-2020
0

show spinner during API request pure html and jquery

$('#loadingDiv')
    .hide()  // Hide it initially
    .ajaxStart(function() {
        $(this).show();
    })
    .ajaxStop(function() {
        $(this).hide();
    })
;
Posted by: Guest on December-01-2020

Browse Popular Code Answers by Language