Work with legacy and simple sites using jQuery selectors, events, AJAX, effects, and plugins.
Lessons
Turn form fields into a query string or array.
serialize() and serializeArray() is easiest to learn by reading the example, changing it, and observing the result.
$('#contact').on('submit', function (event) {
event.preventDefault();
$.ajax({
url: $(this).attr('action'),
method: 'POST',
data: $(this).serialize() // name=value&name=value
}).done(function () {
$('#status').text('Message sent!');
});
});Practice the serialize() and serializeArray() example in a small scratch file, then explain what changed and why.