get and post
$.get reads data and $.post sends it. Both return a promise like object so you can chain done and fail.
Example
$.get('/api/items', function (data) {
$('#out').text(data.length);
});
$.post('/api/items', { name: 'pen' }).done(function () {
console.log('saved');
});Exercise
Send data.
$.('/api', data)
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.