- Ajax (programming)
XMLHttpRequestobject. 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 do not automatically register themselves with the browser's history engine, so clicking the browser's "back" button may not return the browser to an earlier state of the Ajax-enabled page, but may instead return to the last full page visited before it. Workarounds include the use of invisible iframes to trigger changes in the browser's history and changing the URL fragment identifier (the part of a URL after the '#') when Ajax is run and monitoring it for changes.
- However, HTML5 provides an extensive API standard for working with the browser's history engine.
- 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). This can lead to longer response times and/or additional hardware needs.
- The asynchronous, callback-style of programming required can lead to complex code that is hard to maintain, to debug and to test.
- Ajax framework
- Comet (programming)
- List of Ajax frameworks
- Reverse Ajax
- Rich Internet application
- ^ a b c Jesse James Garrett (2005-02-18). "Ajax: A New Approach to Web Applications". AdaptivePath.com. http://www.adaptivepath.com/ideas/essays/archives/000385.php. Retrieved 2008-06-19.
- ^ a b Ullman, Chris (March 2007). Beginning Ajax. wrox. ISBN 978-0-470-10675-4. http://www.wrox.com/WileyCDA/Section/id-303217.html. Retrieved 2008-06-24.
- ^ "Code Samples and Apps: Applets". Sun Microsystems, Inc.. http://java.sun.com/applets/. Retrieved 2009-01-02.
- ^ a b Hinchcliffe, Dion (June 2006). Real-World Ajax: Secrets of the Masters. SYS-CON Media. ISBN 978-0-9777622-0-0. http://ajaxdevelopersjournal.com/read/338113.htm.
- ^ US patent 7058944, Thomas Alan Sponheim & Kris Owens, "Event driven system and method for retrieving and displaying information", issued 2006-6-6
- ^ "Dynamic HTML and XML: The XMLHttpRequest Object". Apple Inc. http://developer.apple.com/internet/webcontent/xmlhttpreq.html. Retrieved 2008-06-25.
- ^ Hopmann, Alex. "Story of XMLHTTP". Alex Hopmann’s Blog. http://www.alexhopmann.com/story-of-xmlhttp/. Retrieved 17 May 2010.
- ^ a b c "A Brief History of Ajax". Aaron Swartz. 2005-12-22. http://www.aaronsw.com/weblog/ajaxhistory. Retrieved 2009-08-04.
- ^ But use of VBScript assumes the target browser supports it.
- ^ "Speed Up Your Ajax-based Apps with JSON". DevX.com. http://www.devx.com/webdev/Article/32651. Retrieved 2008-07-04.
- ^ a b "Why use Ajax?". InterAKT. 2005-11-10. http://www.interaktonline.com/support/articles/Details/Ajax:+Asynchronously+Moving+Forward-Why+use+Ajax%3F.html?id_art=36&id_asc=309. Retrieved 2008-06-26.
- ^ a b "Deep Linking for AJAX". http://blog.onthewings.net/2009/04/08/deep-linking-for-ajax/.
- ^ a b "HTML5 specification". http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html. Retrieved 2011-10-21.
- ^ Prokoph, Andreas (2007-05-08). "Help Web crawlers efficiently crawl your portal sites and Web sites". IBM. http://www.ibm.com/developerworks/library/x-sitemaps/index.html. Retrieved 2009-04-22.
- ^ Quinsey, Peter. "User-proofing Ajax". http://www.alistapart.com/articles/userproofingajax.
- ^ "WAI-ARIA Overview". http://www.w3.org/. http://www.w3.org/WAI/intro/aria.php. Retrieved 2010-10-21.
- ^ Edwards, James (2006-05-05). "Ajax and Screenreaders: When Can it Work?". sitepoint.com. http://articles.sitepoint.com/article/ajax-screenreaders-work. Retrieved 2008-06-27.
- ^ "Access Control for Cross-Site Requests". World Wide Web Consortium. http://dev.w3.org/2006/waf/access-control/. Retrieved 2008-06-27.
- ^ "Secure Cross-Domain Communication in the Browser". The Architecture Journal (MSDN). http://msdn.microsoft.com/en-us/library/bb735305.aspx. Retrieved 2010-04-27.
- ^ "Selenium documentation: Fetching a Page". http://seleniumhq.org/. http://seleniumhq.org/docs/03_webdriver.html#fetching-a-page. Retrieved 2011-10-06. "It’s worth noting that if your page uses a lot of AJAX on load then WebDriver may not know when it has completely loaded. If you need to ensure such pages are fully loaded then you can use an Explicit and Implicit Waits."
- Ajax: A New Approach to Web Applications Article that coined the term and Q&A.
- Ajax (programming) at the Open Directory Project
- Ajax Tutorial with GET, POST, text and XML examples.
Cloud computing Clients Applications Platforms Infrastructure Technologies
Wikimedia Foundation. 2010.