alt
Advertisement
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow Client Server arrow Ajax and Web Applications
Site Search


Ajax and Web Applications
Article Index
Ajax and Web Applications
How does Ajax Work?

How does Ajax Work?

Ajax adds a layer to web application communication models. As previously stated, in traditional web applications communication between the browser/client and the web server occurred directly between these two components using HTTP requests. When users/clients request web pages, the server sends all the HTML and CSS code at once. If the user enters information into this page and requests more servers, the entire page must be loaded again. When using Ajax, the page is only loaded once. Any processing or modification caused by additional user input occurs in real time.

In addition to HTML and CSS code, Ajax also downloads JavaScript files. These three components make up the Ajax engine. So all requests for data from the server will be sent as JavaScript calls to this engine, which is located as a communication layer between the browser and the server. The Ajax engine or layer processes subsequent requests that may change the appearance or function of the web page. By requesting information from the server asynchronously, Ajax sends page bits to request services from the server as needed.

The engine allows these bits or responses to be displayed without reloading the entire page. This makes web pages and web applications much more responsive since only the necessary information is communicated between clients and servers instead of the entire page. This process imitates the responsiveness of desktop applications. Similarly, Ajax conducts all HTTP requests in the background, preventing user disruption. Users can continue working while the page sections are requested and delivered. With Ajax, the user interface is much more closely connected to application logic.

Advantages and Disadvantages of using Ajax

Because Ajax applications are more difficult to build than classic web applications, they must contain certain advantages that make them worth it. Applications built with Ajax have much more responsive interfaces. Users experience changes in a way that feels instantaneous. In traditional web applications, multiple connection threads are used to speed up deliveries between client and server. But this only affects content. All scripts and format information are communicated through a single connection thread, which negatively impacts performance. Ajax uses multiple connections to load basic scripts and CSS files; the rest is requested as content.

Again, responsiveness and timesaving are some of the most important features of Ajax. Visitors no longer have to wait for the page to be entirely re built and re sent when they make new requests. Only relevant content changes and users can still interact with the web site. There is also protection from errors. When an error is identified on a web page section, the rest of the page is unaffected and entered data is not lost. Ajax use also reduces server traffic and bandwidth use because the entire information doesn’t need to be sent with every new request.

The primary disadvantages include increased development time and costs, even though using Ajax can be more difficult to use when building applications rather than traditional client server web applications. However, this is tempered by the fact that most of the technologies that make up Ajax are already known. Ajax’s asynchronous nature can also cause conflict because it interferes with traditional ways of navigating the web and book marking sites.

For example, when parts of the page change, other parts of the page no longer correspond to the new page. This means bookmarks or web browser history will not be able to locate the page in an exact state. Also, the ‘Back’ function will sometimes not work because the URL (Uniform Resource Locater) of the page hasn’t changed, even if sections of the page have. Perhaps the biggest disadvantage of Ajax is accessibility. Not all browsers support JavaScript or XMLHttpRequest. XMLHttpRequest also prohibits the display of information from another server. For security, it only displays information from the server that responds to the initial requests.


Trackback(0)
Comments (0)add comment

Write comment

busy

 
< Prev
Sponsored Links
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape