ajax call do something while
$('#loading').show() //show spinner
$.ajax({
url: '/path/to/file',
type: 'GET',
data: {param1: 'value1'},
})
.done(function() {
console.log("success");
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
$('#loading').hide();//hide your spinner here!!
});
Also in JavaScript:
- Javascript remove all child elements
- javascript clear style inline property
- open new tab with javascript
- export multiple functions react
- Math.ceil
- get last element in array in javascript
- javascript string keys
- localstorage.getitem()
- leaflet geojson style stroke width
- js tab in textarea
- build apk react native
- append css file with javascript
- how to comments in json file
- for loop inside a for loop javascript
- textinput onpress react native
- string and charater alphabet order
- Prevent Multiple Form Submissions With JQuery
- javascript pass iterator to callback
- datepicker range npm reactjs
- push notification not working on standalone react native
- if function example
- cypress
- chack var exist for skip error on javascript
- toggle class javascript stack overflow