Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to know if ajax is running

// site.js
$(function() {
    window.ajax_loading = false;
    $.hasAjaxRunning = function() {
        return window.ajax_loading;
    };
    $(document).ajaxStart(function() {
        window.ajax_loading = true;
      	console.log('started')
    });
    $(document).ajaxStop(function() {
        window.ajax_loading = false;
      	console.log('stopped')
    });
});
//logs in dev console whenever an ajax process starts and/or stops
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery select dropdown option 
Javascript :: modal show with jquery ready function 
Javascript :: express middleware 
Javascript :: create a form and submit it dynamically jquery 
Javascript :: how to erase spaces from a string javascript 
Javascript :: mongodb group by several fields 
Javascript :: convert date to string javascript 
Javascript :: conditional style react native 
Javascript :: react-native eject not working 
Javascript :: how to remove an object from array in react native 
Javascript :: MongoParseError: options buffermaxentries, usefindandmodify, usecreateindex are not supported 
Javascript :: aws amplify get JWT TOKEN 
Javascript :: lodash pick 
Javascript :: js and 
Javascript :: click events javascript 
Javascript :: axios Request body larger than maxBodyLength limit 
Javascript :: angular generate without spec 
Javascript :: js browser tab inactive check 
Javascript :: conditional classname prop react 
Javascript :: react hook form reset 
Javascript :: uploading file with fetch in js 
Javascript :: eintegrity npm error 
Javascript :: js sort letters 
Javascript :: express js url with id 
Javascript :: javascript get array object by id 
Javascript :: object json parse javascript 
Javascript :: quotation marks javascript 
Javascript :: converting strings to numbers 
Javascript :: how to find hcf of 2 numbers in javascript 
Javascript :: file upload in jquery 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =