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!

Tags: , , , ,

1 Comment on Basic Ajax usage with jQuery

  1. Hisham Aridi says:

    I tried the form and it worked fine but I was wondering if it can be modified to include image button. I tried to modify it but with no sucsess. Basicaly I created a rdio buton group but I need to replace the radio butoon with image. I appreciste the help.

Leave a Reply to Hisham Aridi Cancel reply

*