Skip to content
Justice Tech School

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

Which method sends data?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.