Ajax is, in short, the process of communicating with a webserver from a page, using JavaScript, without leaving the page.
The key things you need to know for this are:
- The JavaScript needed to make the request and handle the response
- The server side code needed to receive the request and make the response (unless you are using a service that provides this for you)
The server side of this depends very much on what server side environment you are working with, so there is little useful that is specific that could be said. What can be usually said are what form the responses can take.
- JSON is a popular approach for sending structured data.
- XML is another way to send structured data, but has been falling out of favour of late since JSON is, arguably, easier to work with.
- Chunks of HTML are popular for shoving into pages with
innerHTML.
- Tiny bits of plain text are useful for simple responses.
As for the client side, there are three common approaches:
- XMLHttpRequest: Well supported and flexible.
- fetch: A replacement for XHR with a nicer API but more limited browser support.
- JSONP: A hack to work around the Same Origin Policy rendered obsolete by the introduction of CORS but which you might stumble across from time to time.
I mentioned the Same Origin Policy above. Normally a script isn't allowed to read data from another domain for security reasons. The CORS standard allows you to work around this.
Now for some resources:
- The W3C provides a good guide to JavaScript and other web standards if you need some background.
- MDN also has an introduction to JS
- MSN has a good guide to the XMLHttpRequest object
- Ajaxian has an introduction to JSON-P
- jQuery has functions to help with Ajax.