Ajax Mode 2

Source: Internet
Author: User

Chapter 3

Pattern Design describes how a program solves all common problems. As a matter of fact, there are already solutions. using existing design patterns to solve the problem will reduce the development time.
Ajax also has many design patterns to solve specific problems. For example, it is the hidden frame technology, asynchronous XMLHTTP request, which uses the communication mode between the client and the server using JavaScript.
Michael mahemoff recorded these patterns, his

Githubhttps: // github.com/mahemoff

Home page: http://mahemoff.com /.

Ajax design patterns (Michael mahemoff)

Each design pattern is not fixed and simple to apply, which means that developers concentrate on each pattern and design a suitable scheme to correspond to their own application functions.

 

Communication Control Mode: javascript can be used to communicate with the server. The question is, when is the best time for a client to send a request to the server? In some cases, information is pre-loaded from the server and can be provided to the user immediately during user operations. In other cases, you may want to send and receive data to the server at a certain interval. Or, not all things are loaded at a time, but in a certain order. Ajax provides a good interval to control the communication between the server and the client to achieve the desired effect.

Prediction data acquisition mode: assume that you use ajax to pre-load data in the next step. For example, if you are reading a 3-page article and when you are reading the first page, you can load the second page after several seconds, so that you can provide data immediately when you press the second page. Another example is email. When a user writes an email, the user's address book can be preloaded, and a prompt message is provided when the user inputs the address. Both Gmail and AOL webmail in the email system use this mode. When this mode is used, there is a logical prediction, and the information provided can help the user complete the next step.

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.