$.ajax(<url-to-fetch>,<a-configuration-object>);
$.ajax(<just a configuration object>);
var settings = {
frosting: 'buttercream',
colors: ['orange', 'blue'],
layers: 2,
isRound: true
};
const myDeliciousCake = MakeCake({
frosting: 'buttercream',
colors: ['orange', 'blue'],
layers: 2,
isRound: true
});
$.ajax({
url: 'http://swapi.co/api/people/1/'
});
function handleResponse(data){
console.log('the ajax request has finished!');
console.log(data);
}
$.ajax({
url: 'http://swapi.co/api/people/1/'
}).done(handleResponse);