loading page for all ajax call in jquery 3.3.1
$.when(ajax1(), ajax2(), ajax3(), ajax4()).done(function(a1, a2, a3, a4){
// the code here will be executed when all four ajax requests resolve.
// a1, a2, a3 and a4 are lists of length 3 containing the response text,
// status, and jqXHR object for each of the four ajax calls respectively.
});
function ajax1() {
// NOTE: This function must return the value
// from calling the $.ajax() method.
return $.ajax({
url: "someUrl",
dataType: "json",
data: yourJsonData,
...
});
} $(document).ajaxStart(function () {
$('#ajax-loading-image').css("display", "block");
});
$(document).ajaxStop(function () {
$('#ajax-loading-image').css("display", "none");
});
Also in JavaScript:
- javascript get black or white text base on color
- js copy array
- js try..catch works synchronously.
- vue js implementation
- see all functions in a website with console
- get select option count using jquery
- javascript onclick
- smooth user navigation react native maps
- js indexof
- currentTime(); javascript
- js queryselector names
- remove menu bar electron
- instantiate js
- javascript promise.all
- express-jwt error algorithms should be set
- how to add onclick event in javascript
- eslint disable block
- electron didn't know require
- javascript array find
- quicksort javascript
- how to use session using javascript
- reverse an array javascript
- react function exec when button is clicked
- how to add button react native app.js