Tags: JS
Copy this template for ajax calls. You can either pass individual variables inside data, or collect them all in one object and pass that.
$.ajax({
url: 'url/url',
method: 'post',
datatype: 'json',
data: { data }
})
.always(function() {
// do every time
})
.done(function(data) {
// it worked
})
.fail(function(data) {
// it failed
});
©2023, kirillsimin.com