Custom WordPress AJAX — a practical guide to custom WordPress AJAX with clear examples you can reuse in real projects.
jQuery Tutorial Series (79/101). Prefer one article? Read the complete jQuery tutorial.
Short description
Prefer wp_send_json_success / wp_send_json_error helpers.
Custom AJAX sketch
$.post(ajaxurl, {
action: 'save_note',
note: $('#note').val(),
_ajax_nonce: noteNonce
}).done(function (res) {
if (res.success) { /* ... */ }
});