Java EE 5 weeks Ajax

Source: Internet
Author: User

AJAX , "asynchronous JavaScript and XML" (Asynchronous JavaScript and XML technology), refers to a set of browser-side web development techniques that combine a number of technologies. The concept of Ajax is presented by Jessi James Jarrett.

Traditional Web applications allow the user to fill out a form (form) and send a request to the Web server when the form is submitted. The server receives and processes the incoming form and then sends it back to a new webpage, but it wastes a lot of bandwidth because most of the HTML code in the front and rear two pages is often the same. Since each application communication 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 native application.

Unlike this, an AJAX application can send and retrieve only the necessary data to the server, and the client uses JavaScript to handle the response from the server. Because the amount of data exchanged between the server and the browser is much reduced, the server responds faster. At the same time, a lot of processing can be done on the client machine making the request, so the load on the Web server is reduced.

Similar to DHTML or Lamp,ajax does not refer to a single technique, but rather organically utilizes a range of related technologies. Although its name contains XML, the data format can actually be replaced by JSON, further reducing the amount of data to form so-called Ajaj. The client and server do not need to be asynchronous either. Some Ajax-based "derivation/composition" (Derivative/composite) technologies are also emerging, such as Aflax

The biggest advantage of 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 is 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 main criticism of applying Ajax is that it can disrupt the browser's back-up and bookmark-collection features. 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 possible difference between a fully read-in page and a page that has been dynamically modified is very subtle; the user usually wants to click the Back button to cancel their previous operation, but in an AJAX application it is impossible to do so. However, developers have come up with ways to solve this problem, most of the previous approach is to reproduce the changes on the page by creating or using a hidden iframe when the user clicks the Back button to access the history HTML5. (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).

One way to do this is by using the URL fragment identifier (often called the anchor, which is the part behind # in the URL) to keep track of the problem of not adding a status to a collection or bookmark, allowing the user to return to the specified application state HTML5. (many browsers allow JavaScript to dynamically update the anchor point, which allows an AJAX application to update the anchor point while updating the display.) HTML5 can then directly manipulate the browsing history and store the state of the page as a string, and the state will be hidden when the page is added to a Web collection or bookmark. Both of these methods can also resolve problems that cannot be backed up.

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. Without a clear response from the user, no proper pre-reading data, or inappropriate handling of the XMLHttpRequest, users will be bored. 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.

Java EE 5 weeks Ajax

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.