What is AJAX?

AJAX is an acronym for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS and Java Script.

What does Asynchronous mean?

Asynchronous refers to events that happen in the background independent of the main application flow. These events do not disturb the flow of the application, allowing the continuation of it’s normal process.

A fairly good example of this happening is in your Facebook home page, when all of a sudden, without refreshing your browser window, you notice that there are new status feed updates from your friends. What happens there is, facebook sends your profile information (or your user id) to their servers. Their servers then look for your friends list, grab their newly added status, return the result to the browser and then add them to your wall so that you can see. All of that, without pressing that refresh button.

So AJAX allows you to update a web page asynchronously on the background by exchanging simple, and small amounts of data. Some more examples of pages using AJAX is: Youtube, Gmail, Google Maps, StackOverflow and many more on the web.

More Details about AJAX:
  • Ajax uses XHTML for content and CSS for presentation, as well as the Document Object Model and JavaScript for dynamic content display.
  • Conventional web application transmit information to and from the sever using synchronous requests. However, with AJAX when submit is pressed, JavaScript makes a request to the server, interprets the results and updates the current screen. In the purest sense, the user would never know that anything was even transmitted to the server (asynchronous request).
  • XML is commonly used as the format for receiving server data, although any format, including plain text, can be used.
  • AJAX is a web browser technology independent of web server software.
  • A user can continue to use the application while the client program requests information from the server in the background.
  • Intuitive and natural user interaction. No clicking required only Mouse movement is a sufficient event trigger.
  • AJAX is data-driven as opposed to page-driven.
  • AJAX, is based on internet standards. It uses a combination of the following to accomplish it’s goal:
    • XMLHttpRequest Object (Modern Broswers and IE7+)
    • ActiveXObject (IE6 and below)
    • JavaScript/DOM (Used to interact browser and server)
    • XML (Returned results)
    • JSON (Returned results)
    • HTML (Returned results)
These standards are browser based, making them platform independent.
  • Another advantage using AJAX is a better user interactivity. AJAX simplifies the flow of an application, making it have quicker interaction between user and website since pages are not reloaded for content to be displayed.
Disadvantages of AJAX
  • Even though the back and refresh button are not needed while navigating a website with AJAX, these two buttons can become useless. This is due to the fact that, AJAX ‘navigating’ does not change you URL, so if you were in the middle of a process, and have no direct URL to where you were, then this might be bad. In some cases, the use of Hijaxing is used, which is the use of hashing url (#) at the end.
  • Another disadvantage would be that it is dependent on JavaScript. While it is OK to depend on it, since most modern (if not all) already use it, but in some cases, there are users who prefer disabling JavaScript. This makes AJAX worthless.
  • The last disadvantage I want to point out would be the SEO factor. Since there are no SEO Friendly URL’s, then search engine tend to bypass your application, and it would appear as if that part of your site does not exist.

No comments:

Post a Comment