jQuery AJAX

To view this screencast, add it to your cart and checkout. You can buy this screencast for any price, including FREE!

A few years back, I watched the Peepcode episode Ajax with Prototype.js. I thought it was the coolest thing ever!
Compared to having to deal directly with XMLHttpRequest objects, it was so easy. But that was way back in 2007.

Now, jQuery is where it’s at. And doing AJAX with jQuery is even easier! Trivial, even!

In this episode, I’ll show you how to:

 1 $.post('/dogs', { 'dog[name]': 'Rover' });
 2 
 3 // you can actually try the following snippets right here, on the blog!  just open Firebug  :) 
 4 
 5 $.get('/index.html', function(html){ alert('got html: ' + html); });
 6 
 7 $('#content').load('/index.html #header');
 8 
 9 $.getJSON('http://search.twitter.com/search.json?q=remitaylor&callback=?',
10           function(tweets){ console.log(tweets.results) });
11 
12 $('a').live('click', function(){ alert("I get bound to new DOM elements"); return false; });