Java EE Fifth Week assignment

Source: Internet
Author: User

I. AJAX technology

AJAX = Asynchronous JavaScript and XML (asynchronous JavaScript and XML).

AJAX is not a new programming language, but a new method of using existing standards.

AJAX is the art of exchanging data with a server and updating parts of a Web page without reloading the entire page.

AJAX is a technique that can update parts of a Web page without reloading the entire page.

What is AJAX?

AJAX = asynchronous JavaScript and XML.

AJAX is a technique for creating fast, Dynamic Web pages.

AJAX enables Web pages to be updated asynchronously by exchanging small amounts of data in the background with the server. This means that you can update a part of a webpage without reloading the entire page.

Two. How Ajax works

Ajax works by adding an intermediate layer between the user and the server, which causes the user operation to be asynchronous with the server response. In this way, some of the previous workload of the server is passed on to the client, which is advantageous to the client's idle processing ability to deal with, reduce the burden of server and bandwidth, so as to save ISP's space and bandwidth leasing cost.

The core of Ajax is the JavaScript object XMLHttpRequest. This object was first introduced in Internet Explorer 5, which is a technique that supports asynchronous requests. In short, XMLHttpRequest allows you to use JavaScript to make requests to the server and handle the response without blocking the user.

When you create a Web site, performing screen updates on the client provides a lot of flexibility for the user. Here are some of the features you can do with Ajax:

Dynamically update the total number of items in your shopping cart without requiring the user to click Update and wait for the server to resend the entire page.

Improve the performance of your site by reducing the amount of data downloaded from the server. For example, on a shopping cart page, when the quantity of an item in the basket is updated, the entire page is re-loaded, and the data for the entire page must be downloaded. If you use Ajax to calculate the new total, the server will only return the new total value, so the required bandwidth is only 1% of the original. The page refresh is eliminated each time the user enters. For example, in Ajax, if a user clicks Next on the paging list, the server data refreshes the list instead of the entire page.
Edit the table data directly, rather than requiring the user to navigate to the new page to edit the data. For Ajax, when the user clicks Edit, the static table can be refreshed as a table with editable content. After the user clicks Done, an AJAX request can be made to update the server and refresh the table to contain static, read-only data.

Three. Advantages of Ajax

1, reduce the burden of the server. Because the fundamental concept of Ajax is "data-on-demand", it is possible to reduce the burden of redundant requests and shadows on the server;

2, no Refresh update page, reduce the user's actual and psychological waiting time;

First, the "data on demand" pattern reduces the actual amount of data read, and, in a very figurative analogy, if the overloaded way is to return from one endpoint to the other, then Ajax will arrive at the other end point as a point of origin, and secondly, even if you want to read larger data, Also do not have the same white screen as reload, because Ajax is used XMLHTTP send requests to get service-side response data, without re-loading the entire page with JavaScript operation DOM finally update the page, so in the process of reading data, the user is not faced with a white screen , but the original page state (or you can add a loading box to let the user know the status of the data read), only after receiving all the data to update the corresponding part of the content, and this update is instantaneous, the user can hardly feel. In short, the user is very sensitive, they can feel you to their thoughtfulness, although not likely to have an immediate effect, but will be in the user's heart little bit of accumulation of their reliance on the site.

3, a better user experience;
4, can also be some of the previous workload of the server passed on to the client, to facilitate the client idle processing capacity to deal with, reduce the burden of server and bandwidth, save space and bandwidth rental costs;
5, Ajax because can call external data;
6, based on standardized and widely supported and technology, and do not need to plug-ins or download small programs;
7, Ajax to make the Web interface and application separation (also can be said that data and rendering separation);
8, for the user and ISP is double surplus.

Four. Problems with Ajax

1, some handheld devices (such as mobile phones, PDAs, etc.) are still not very good to support Ajax;
2, the Ajax engine with JavaScript, JavaScript compatibility and debug are the things that make people headache;

3, Ajax non-refresh overload, because the page changes do not refresh the overloaded 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;

Java EE Fifth Week assignment

Related Article

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.