Tag Archives: ajax

Basic Ajax usage with jQuery

In this article we will be talking about the basic usage of Ajax with jQuery 1.4.2 production (24KB, Minified and Gzipped).

In order to use the JavaScript examples in this article, you should first download jQuery and include it on your page using:


Throughout this article our Ajax scripts will communicate with ‘serverscript.php‘ our Server script.


Method One – POST (Asynchronous with data):

Transfer data to the server (using POST method), and retrieve a response:


Method Two – GET (Asynchronous with data):

Transfer data to the server (using GET method), and retreive a response:


Note that GET is the default type for Ajax calls using jQuery, so we really do not need to explicitly state it, but I’ve placed it there just for clarity.

Practical jQuery Example using POST:


jQuery Example in Browser

jQuery Example in Browser

Well there you have it, not too tricky and with a weight of only 24Kb for the base library you can’t go wrong. Of course, jQuery can be used for a whole heap of other tasks.

Until next time (when we cover MooTools), Happy A’jaxing!

Basic Ajax usage with X

Over the next several articles I’ll be covering the “Basic Ajax usage with X”, for example “Basic Ajax usage with jQuery”.

The idea is to take the latest stable version of the chosen JavaScript Framework (for example jQuery) and examine what’s required to achieve the most basic Ajax calls.

I’ll be looking at a few things here, notably the ease of use and the minimum required footprint (in regards to download size).

Note that I will not necessary by using Ajax in the traditional sense of the word (i.e. with XML) as the intention of these articles is to strip everything back to the absolute basics.

I’m not 100% certain about all the frameworks I’ll cover now, but I will most certainly be covering jQuery, MooTools, Prototype, dojo, YUI and ExtJS. If I have the time, I may look at some of the newer ones as well.

This post is a living post (I’ll revisit and link up the articles).

Cheers guys!