Header Ads

  • Breaking Now

    What is AJAX? Explain in detail how it works.Discuss its advantages and disadvantages.

    AJAX stands for Asynchronous Javascript and XML which is used for developing dynamic web applications. This concept was not new, as a matter of fact asynchronous loading of content without a full reload was existing for a long time.It was known as web remoting or remote scripting.

    AJAX requests data from server in an asynchronous fashion in background without affecting the presentation layer.Hence Ajax interactions allow for a clear separation of presentation logic from the data. In Rich Internet Applications(RIA) , an HTML document acts as a template or container where content is injected, based on client events using XML data retrieved from a server-side component.The functioning of data exchange between web browser and server occurs with XMLHttpRequest object is used which is inherent with JavaScript technology.It is supported by most of the browsers like IE7.0,Mozilla's Firefox,Safari etc.

    In AJAX applications, as HTTP requests are made completely in the background, the user experiences no interruptions. This means the user can continue working and using the application, while the necessary page sections are received from the server.In IE , the XMLHttpRequest object is implemented as an ActiveX object while Firefox,Safari have it as a native JavaScript object.

    Advantages:
    - The reload of web pages is reduced.The response is much more efficient as pieces of UI get updated without much of client's intervention.
    - The client request handling is done efficiently where a user can keep on working on the same web page without knowing there is an exchange of data going on with server.
    - Wait time is reduced
    - You send only the necessary information from client to server and not whole of the content is sent to and fro with several  ongoing data exchanges.

    Disadvantages:
    - Increased development time and cost
    - Security and user privacy is a major concern as AJAX has to mature.
    - Most of search engine and prominently Google do not index applications using AJAX technology. This may be a major concern for e-commerce centric web applications.
    - XMLHttpRequest object has a constraint of pulling information only from the server where the first web page is getting loaded and it can not pull information from other server.
    -  Not all the web browsers support AJAX based web applications especially old versions. While designing application make sure of a fail-safe solution, so it can be accessed by anyone.Do ensure your AJAX based application works for most of advanced web browser especially in case of IE handling is done in a different way.

    Post Top Ad

    Post Bottom Ad