AJAX refers to asynchronous JavaScript and XML (Asynchronous JavaScript and XML(asynchronous JavaScript and XML)refers to a web development technique that creates interactive Web applications. The usual pronunciation of "Ajax" in China is the same as the Ajax football team. Definition of Ajax (asynchronous JavaScript + XML)
[2]
Representation based on the Web Standard (standards-based presentation) xhtml+css;
Use the DOM (Document Object Model) for dynamic display and interaction;
Using XML and XSLT for data exchange and related operations;
Using XMLHttpRequest to query and retrieve asynchronous data;
Ajax uses JavaScript to bind everything together. In English see the author of Ajax, the original text of Jesse James Garrett, the original topic (Ajax:a New approach to WEB applications). Similar to DHTML or Lamp,ajax does not refer to a single technique, but rather organically utilizes a range of related technologies. In fact, some Ajax-based "derivation/composition" (derivative/composite) technologies are emerging, such as "Aflax".
Ajax applications use a Web browser that supports the above technologies as a running platform. These browsers currently include: Mozilla, Firefox, Internet Explorer, Opera, Konqueror, and Safari. However, Opera does not support XSL format objects, nor does it support XSLT.
Many important technologies and Ajax development patterns can be obtained from existing knowledge. For example, in an app that sends a request to the server, it must contain the order of requests, priority, timeout response, error handling, and callbacks, many of which are already included in the Web service, just like today's SOA. Ajax developers have a complete knowledge of the system architecture. At the same time, as technology matures there are many areas that need to be improved, especially the ease of use of UI parts.
Ajax development differs greatly from the traditional CS development. These differences introduce new programming problems, the biggest problem is ease of use. Because Ajax relies on browser-based JavaScript and XML, browser compatibility and support standards have become as important as JavaScript's runtime performance. Most of these problems come from a combination of browsers, servers, and technologies, so you must understand how best to use these technologies.
Ajax presents a new way to develop a variety of technologies and a highly-coupled customer-service environment. Ajax developers must understand the traditional MVC architecture, which limits the boundaries between application hierarchies. At the same time, developers need to consider the external of the CS environment and use AJAX techniques to re-stereotype MVC boundaries. Most importantly, AJAX developers must disallow Web applications as a collection of pages and need to consider them as a single page. Once the scope between the UI design and the service architecture is strictly differentiated, developers need to update and change the technology collection.
What are the advantages of Ajax
Traditional web apps allow users to fill out forms (form) and send a request to the Web server when the form is submitted. The server receives and processes the form, and then returns a new page. This approach wastes a lot of bandwidth because most of the HTML code in the last two pages is often the same. Because each application interaction requires a request to the server, the response time of the application depends on the response time of the server. This causes the user interface to respond much more slowly than the local application.
Unlike this, an AJAX application can send and retrieve only the necessary data to the server, using SOAP or some other XML-based Web service interface, and using JavaScript on the client to process the response from the server. Because the amount of data exchanged between the server and the browser is much reduced, the result is that we can see applications that respond faster. At the same time, a lot of processing can be done on the client machine making the request, so the processing time of the Web server is also reduced.
The biggest advantage of using AJAX is the ability to maintain data without updating the entire page. This allows the Web application to respond more quickly to user actions and avoids sending information that has not changed on the network.
Ajax does not require any browser plugins, but requires the user to allow JavaScript to be executed on the browser. Like the DHTML application, AJAX applications have to undergo rigorous testing on many different browsers and platforms. With the maturation of Ajax, a number of libraries that simplify the use of Ajax have been introduced. Similarly, there is another assistive programming technique that provides alternative functionality for users who do not support JavaScript.
The shortcomings of Ajax still exist
The main criticism of applying Ajax is that it can disrupt the normal behavior of browser back buttons. In the case of dynamically updating the page, the user cannot go back to the previous page state because the browser can only record static pages in the history. The difference between a fully read page and a page that has been dynamically modified is very subtle; users often want to click the Back button to cancel their previous operation, but in an AJAX application it is not possible to do so. But developers have come up with ways to solve this problem, most of which is to reproduce changes on the page by creating or using a hidden iframe when the user clicks the Back button to access the history. (for example, when a user clicks back in Google Maps, it searches in a hidden iframe and then reflects the search results on an AJAX element to restore the application state to its current state.) )
A related view is that using dynamic page updates makes it difficult for users to save a particular state to a collection. The solution for this problem has also occurred, with most of the URL fragment identifiers (often referred to as anchors, which are the parts of the # URL) to keep track of, allowing the user to return to the specified application state. (many browsers allow JavaScript to dynamically update the anchor point, which allows an AJAX application to update the anchor point while updating the display.) These solutions also address many of the arguments that do not support back buttons.
With Ajax development, network latency-that is, the interval between a user sending a request to a server to make a response-requires careful consideration. Not giving users a clear response, without proper pre-reading data, or improper handling of XMLHttpRequest, will make users feel delayed, which is not what users want to see, but they do not understand. A common solution is to use a visual component to tell the user that the system is in the background and is reading data and content.
Some handheld devices (such as mobile phones, PDAs, etc.) are not yet well-supported Ajax;
JavaScript ajax engine, JavaScript compatibility and debug is a headache;
Ajax non-refresh overload, because the page changes do not refresh the overload so obvious, so easy to bring trouble to users-users are not very clear whether the current data is new or has been updated, the existing solution is: in the relevant location hints, data Update area design is more obvious, the data updated to the user prompt;
Support for streaming media is not as good as Flash or Java applet;
Introduction to Ajax