Sat. Jun 15th, 2019

Ajax

Ajax XMLHttpRequest Object

A robust Ajax Style web application has fine control over communication, including the ability to get and set HTTP headers, read response codes and deal with a different kind of server content. The JavaScripts XMLHttpRequest object is used to address all the problems of Ajax applications.

Pre-Ajax Communication Techniques

There are many ways to communicate with the server using JavaScript. The most common techniques used in the pre-Ajax communication were image requests, inline frames and the script tags. Simple use of remote JavaScript is to send a request to the server to indicate that some event happened such as clicking a link to another website.

Introduction to Ajax

Ajax web applications use a different model where user actions trigger behind the scenes communication to the server fetching just the data needed to update the page in response to the submitted actions. This process happens asynchronously, allowing the user to perform other actions within the browser while data is returned.

How Ajax Works

Traditional Web Applications tend to follow the pattern that is the first page is loaded when the user performs some actions such as filling a form or clicking a link. The user activity is then submitted to a server side program for processing while the user waits until finally a result is sent back to the user, which reloads the entire web page.