There are 5 articles on this title. You are reading the article ranked and rated #3 by Helium's members.
click the Submit button for the form to be sent to the server and then wait for the data to be included in a web page at the server and then sent back to the client. In some cases the page at the server would already be ready and then it would be sent by the server to the client. Here I give you the advantages of Ajax over this traditional method.
- With Ajax data is retrieved from the server faster than when it had to be retrieved as a web page.
- If processing of the retrieved data is done at the client, your processing time at the server is saved.
- The speed of interaction between browser and web server as a result of speed of retrieving data is increased.
Technical Aspects
Ajax consists of two code parts; one part is in JavaScript at the client and the other part is at the server. The part at the server can be in Perl, PHP or some other language. The part at the client, calls the part at the server. In this two part article series, I will explain only the part at the client's browser. What the part at the server has to do is to look for the data at the server and send in response to the part (request) at the client. The code at the server does not involve anything new. Different programs like Perl and PHP have their different ways of achieving this and so I cannot address that in this article (series).
Ajax at Client
At the client you write Ajax is JavaScript code. The code has to do the following:
- Open (start) a connection between the client computer and the server.
- Send the request for the information (text) the user needs.
- Wait for the response (this normally takes a short time) and receive it.
JavaScript has an object that can achieve all the above three objectives. Note that objects make programming easy. With objects like the one of interest, the difficult programming statements have already been written by someone else. You simply have to use the object. All you have to know here is how to use the object's properties and methods. These properties have already been declared for you; the methods have already been defined for you; you just have to know how to use them and use them. We shall learn how to use them and use them in this article.
The XMLHttpRequest Constructor
You, the web programmer is the one to create the JavaScript object that will carry out the above objectives. You do this by simply using the constructor function,
new XMLHttpRequest()
For example, if you want the object to be called myAjax, in your JavaScript, you would type:
var myAjax
Below are the top articles rated and ranked by Helium members on:
by AJL
I cannot express how much I really LOVE AJAX. I have been a web developer for the past 8 years and I have to say that microsoft's
by Obsidian
What is AJAX? Well, the textbook definition, Asynchronous JavaScript and XML, is not of much help to the average reader and
by Chrys
Making Ajax Request
Ajax Web Technology Explained Part 1
Introduction
This is part 1 of my article series, Ajax Web Technology
The acronym Ajax meaning Asynchronous Javascript and XML,refers to the use of several web technologies in an application
by ARC IDEA CO
In e-business's point of view, in order to appeal to its customers of clientele, you need to have a website or a web front.
Add your voice
Know something about Ajax web technology explained?
We want to hear your view.
Write now!
Featured Partner
MENTOR - National Mentoring Partnership
MENTOR has partnered with Helium, giving you the chance to write for a cause. Browse MENTOR's featured titles, p...more
hide