|
AJAX is one of the hottest new technologies, in the ever growing universe of Web development. In this article, we’ll get to know how AJAX fits in a real-world situation and how you can assess its value in a project. Hopefully, by the time you finish reading this article, you’ll know what AJAX is, why, and how to use it.
The normal routine in Web development involves requesting a file from the Web Server and receiving a page as response. So what’s diiferent with AJAX? The difference, is that requests are being made from the Client side Java Script, which is embedded within HTML.
So what is AJAX ?
AJAX is acronym of Asynchronous Java Script and XML
Asynchronous:
Imagine you are the User, and you have sent some request to the Web server via Hypertext Transfer Protocol (HTTP). In regular Web technology, you must wait for the Web server to respond. In AJAX, while you are waiting for the response , you are free to do some processing on the same page you have requested. Since your response may not come back immediately what you can do is, set up a function which will wait for it to be sent from the server, and which will be authorized to respond back.
Java Script :
As all we know, Java script is used to make request to the server. Once you get the response back from the server you can use the document object model in some way to show output. That is, the submission is done successfully.
XML :
The data you receive back from the server, will often be packaged as a snippet of XML, since it can be easily processed with Java script. However, any type of text file can be used with AJAX.
In AJAX, the request to server is being done through Hypertext Transfer Protocol (HTTP). The speciality of AJAX is that, the client side script can continue with the process, even while waiting for the response from the Web server. So its called Asynchronous.
So let’s keep this simple. We retrieve data from a database as XML, make the calls to a server-side script, then send data to a server-side script that has to be stored in a database. Or simply load the XML file in order to populate pages of your website without refreshing the page. This article will help you to determine, when AJAX is a good solution for developing your users’ experiences.
I will assume that one has the basic understanding of the Java, Java Script and XML part of the acronym. Although one can request any type of text file with AJAX, here we focus only on XML. You’re going to learn how to create the object, make a request, and customize the available response, while maintaining a good practice that provides an intuitive user experience. Ultimately it is the user experience that is going to count more than anything else.
Let’s Do AJAX:
To begin with, you need to create an XML file, that we will use in our AJAX program. Keep in mind, that the file you’re requesting must reside on the same server as the finished project resides.
|
There are currently no comments posted for this article.