· Real-time form data validation: Form data such as user IDs, serial numbers, postal codes, or even special coupon codes that require server-side validation can be validated in a form before the user submits a form.
· Autocompletion: A specific portion of form data such as an email address, name, or city name may be autocompleted as the user types.
· Load on demand: Based on a client event, an HTML page can fetch more data in the background, allowing the browser to load pages more quickly.
· Sophisticated user interface controls and effects: Controls such as trees, menus, data tables, rich text editors, calendars, and progress bars allow for better user interaction and interaction with HTML pages, generally without requiring the user to reload the page.
· Refreshing data and server push: HTML pages may poll data from a server for up-to-date data such as scores, stock quotes, weather, or application-specific data. A client may use Ajax techniques to get a set of current data without reloading a full page. Polling is not the most effecient means of ensuring that data on a page is the most current. Emerging techniques such as Comet are being developed to provide true server-side push over HTTP by keeping a persistent connection between the client and server. See this blog entry on Comet using Grizzly for more on the development of server push with Java technology.
· Partial submit: An HTML page can submit form data as needed without requiring a full page refresh.
· Mashups: An HTML page can obtain data using a server-side proxy or by including an external script to mix external data with your application's or your service's data. For example, you can mix content or data from a third-party application such as Google Maps with your own application.
Page as an application: Ajax techniques can be made to create single-page applications that look and feel much like a desktop application. See the article on the use of Ajax and portlets for more on how you can use portlet applications today.
· Portability — AJAX applications use well-documented features present in all major browsers on most existing platforms. Though this situation could feasibly change in the future, at the moment, AJAX applications are effectively cross-platform. While the Ajax platform is more restricted than the Java platform, current AJAX applications effectively fill part of the one-time niche of Java applets: extending the browser with lightweight mini-applications.
· Interactivity — Ajax applications are mainly executed on the user's machine, by manipulating the current page within their browser using document object model methods. AJAX can be used for a multitude of tasks such as updating or deleting records; expanding Web forms; returning simple search queries; or editing category trees — all without the requirement to fetch a full page of HTML each time a change is made. Generally only small requests are required to be sent to the server, and relatively short responses are sent back. This permits the development of more interactive applications featuring more responsive user interfaces due to the use of DHTML techniques.
· Browser Usability — One major complaint voiced against the use of AJAX in Web applications is that it might easily break the expected behavior of the browser's back button. The different expectations between returning to a page which has been modified dynamically versus the return to a previous static page might be a subtle one. Users generally expect that clicking the back button in Web applications will undo their last state change and in AJAX applications this might not be the case. Developers have implemented various solutions to this problem, most of which revolve around creating or using invisible iFRAMEs to invoke changes that populate the history used by a browser's back button.
A related issue is that dynamic Web page updates make it difficult for a user to bookmark a particular state of the application. Solutions to this problem exist, many of which use the URL fragment identifier to keep track of, and allow users to return to, the application in a given state. This is possible because many browsers allow JavaScript to update the fragment identifier of the URL dynamically, so that AJAX applications can maintain it as the user changes the application's state. This solution also improves back-button support.
· Response time — Network latency — or the interval between user request and server response — needs to be considered carefully during AJAX development. Without clear feedback to the user, smart preloading of data, and proper handling of the XMLHttpRequest object, users might experience delay in the interface of the Web application. The use of visual feedback to alert the user of background activity and/or preloading of content and data are often suggested solutions to these latency issues.
· JavaScript — While no browser plug-in is required for AJAX, it requires users to have JavaScript enabled in their browsers. This applies to all browsers that support AJAX except for Microsoft Internet Explorer 6 and below which additionally require ActiveX to be enabled, as the XMLHttpRequest object is implemented with ActiveX in this browser.
As with DHTML applications, AJAX applications must be tested rigorously to deal with the quirks of different browsers and platforms. A number of programming libraries have become available as AJAX has matured that can help ease this task. Likewise, techniques have been developed to assist in designing applications which degrade gracefully and offer alternative functionality for users without JavaScript enabled.
Web developers use AJAX in some instances to provide content only to specific portions of a Web page, allowing data manipulation without incurring the cost of re-rendering the entire page in the Web browser. Non-AJAX users would optimally continue to load and manipulate the whole page as a fallback, allowing the developers to preserve the experience of users in non-AJAX environments (including all relevant accessibility concerns) while giving those with capable browsers a much more responsive experience.
No comments:
Post a Comment