StepsEasy
jQuery AJAX Events - Example
Run
Reset
Destroy & Close
← Back to lesson
Code Editor
javascript
// GET request $.get('/api/users', function(data) { console.log(data); }); // POST request $.post('/api/users', { name: 'Alice', email: 'alice@example.com' }, function(response) { console.log('Created:', response); }); // Full AJAX $.ajax({ url: '/api/users', method: 'GET', dataType: 'json', success: function(data) { console.log(data); }, error: function(xhr) { console.error(xhr.status); } });
Result
Click "Run" to execute the code...
Loading runtime...
Ready
JAVASCRIPT | In-Browser Execution