Theresa's Blog
This is the blog used for Web 404
Entry for November 15, 2007

AJAX – What is it and what does it do?


The website http://www.w3schools.com/ajax/ajax_browsers.asp has some simple answers to this question.  AJAX stands for Asynchronous JavaScript And XML.  It points out that before learning AJAX you must have a good grasp of HTML/XHTML and JavaScript.  It further explains that AJAX is not a new programming language, but rather the combination of existing web development tools.   AJAX is a technique used to create better, faster and more interactive web applications.  AJAX uses asynchronous data transfer (HTTP request) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.  Most importantly AJAX is a browser technology that is independent of web server software and is supported by all major browsers. 


Now, what exactly does this all mean to the general internet user?   With traditional coding, when the user wants to get information from a server, or send information to a server, the user would have to click on some type of “submit” button and then wait for the server to respond and load a whole new page.  Because of this process, interaction with the server is slow and not very user-friendly.  With AJAX,  the JavaScript communicates directly with the server using an XMLHttpRequest object.  With this type of request, a web page can make a request and get a response from a server, without reloading the whole page.


As mentioned the article, “AJAX: A cleaner Web Workspace” written by Todd Spangler for Baseline, Netflix has adopted AJAX to improve the use of its website.  Now when a customer wants more information about a movie, the information is displayed on screen, without a whole new page loading.  The site also displays movie posters when the user hovers over a certain movie title.  The site responds almost as if the program were installed directly on the client’s computer.


The explanation on the website http://webdesign.about.com/od/ajax/a/aa101705.htm gives us a better understanding of the asynchronous piece of AJAX.    In standard Web applications, the interaction between the customer and the server is synchronous.  This means that one thing has to happen bore the other.  For instance, if a customer clinks on a link, the request is sent to the server, and the server sends the results back.  With AJAX, the JavaScript that is loaded with the page handles most of the basic tasks, such as data validation and display rendering without a trip to the server.  At the same time that it is making these display changes, it is sending data back and forth to the server, but it is independent of the actions of the customers.  This is what is meant by asynchronous.


            As explained in the article “Taking Your Web Site to the Next Level” by John Zayner, in the Tech Directions, many sites use a combination of Client-side and Server-Side scripts.  The difference between the two is where they are located and processed.  Client-side scripts, like those written in JavaScript, are included in the HTML code and are processed by the web browser.  These scripts do not require interaction with the server, and do not require the server to have the scripting language available.  They work off-network and are faster than server-side scripts.  Client-sided scripts can be used for things like field validation.


            Server-side scripts use languages like PHP, ASP and Perl, and are processed by the web server.  They have broader capabilities than client-side scripts.  They are able to interact with other files and databases to store and retrieve information.  Most websites require some type of Server-side scripts to enable their business.  They can be used for a variety of purposes, such as guest books, search engines, and online ordering and billing.  Most websites use a combination of client-side and server side scripts to try and balance the tasks between the client’s browser and the server.
2007-11-16 07:32:12 GMT
Hosted by www.Geocities.ws

1