XMLHttpRequest object. Despite the name, the use of XML is not needed (JSON is often used instead), and the requests do not need to be asynchronous.
In the 1990s, most web sites were based on complete HTML pages; each user action required that the page be re-loaded from the server (or a new page loaded). This process is inefficient, as reflected by the user experience: all page content disappears then reappears, etc. Each time a page is reloaded due to a partial change, all of the content must be re-sent instead of only the changed information. This can place additional load on the server and use excessive bandwidth.
The term Ajax has come to represent a broad group of web technologies that can be used to implement a web application that communicates with a server in the background, without interfering with the current state of the page. In the article that coined the term Ajax, Jesse James Garrett explained that the following technologies are incorporated:
- HTML (or XHTML) and CSS for presentation
- The Document Object Model (DOM) for dynamic display of and interaction with data
- XML for the interchange of data, and XSLT for its manipulation
- The XMLHttpRequest object for asynchronous communication
- In pre-HTML5 browsers, pages dynamically created using successive Ajax requests did not automatically register themselves with the browser's history engine, so clicking the browser's "back" button may not have returned the browser to an earlier state of the Ajax-enabled page, but may have instead returned to the last full page visited before it. A pre-Ajax workaround was to use invisible iframes to trigger changes in the browser's history. A workaround implemented by Ajax techniques is to change the URL fragment identifier (the part of a URL after the '#') when an Ajax-enabled page is accessed and monitor it for changes.
- Dynamic web page updates also make it difficult to bookmark and return to a particular state of the application. Solutions to this problem exist, many of which again use the URL fragment identifier.
- The solution provided by HTML5 for the above problem also applies for this.
- Depending on the nature of the Ajax application, dynamic page updates may interfere disruptively with user interactions, especially if working on an unstable Internet connection. For instance, editing a search field may trigger a query to the server for search completions, but the user may not know that a search completion popup is forthcoming, and if the internet connection is slow, the popup list may show up at an inconvenient time, when the user has already proceeded to do something else.
- Similarly, some web applications which use Ajax are built in a way that cannot be read by screen-reading technologies, such as JAWS. The WAI-ARIA standards provide a way to provide hints in such a case.
- Screen readers that are able to use Ajax may still not be able to properly read the dynamically generated content.
- The same origin policy prevents some Ajax techniques from being used across domains, although the W3C has a draft of the XMLHttpRequest object that would enable this functionality. Methods exist to sidestep this security feature by using a special Cross Domain Communications channel embedded as an iframe within a page, or by the use of JSONP.
- Ajax-powered interfaces may dramatically increase the number of user-generated requests to web servers and their back-ends (e.g. databases).Suleras:Fact This can lead to longer response times and/or additional hardware needs.
- Ajax-heavy interfaces impose a heavy processing load on the browser, which has to execute large, complex scripts and frequently re-render complex pages. This may result in slow, jerky, unresponsive web pages, and also significantly reduces the CPU time available to other applications running on the same system, so that leaving an Ajax-heavy web page open in the browser while working in some other application may cause that application to also be slow and unresponsive.
- Well-known websites that induce such behavior include Facebook and Twitter, both of which use Ajax techniques.
- The additional processing load also increases power consumption, which is particularly undesirable on mobile devices because it reduces battery life.
- The asynchronous callback-style of programming required can lead to complex code that is hard to maintain, to debug and to test.
- Ajax framework
- List of Ajax frameworks
- Comet (programming)
- Reverse Ajax
- Rich Internet application
- Ajax: A New Approach to Web Applications Article that coined the term and Q&A.
- Ajax Tutorial with GET, POST, text and XML examples.
Kamalian sa pagtukoy: Umiiral na ang mga tatak na
<ref>, subalit walang natagpuang tatak na