1 Client-centric AJAX applications
Before developing AJAX applications, we usually first consider the question of whether the application is centered on the client or on the server side. What should be the client-centric and under what circumstances should the server-side be centered? To answer this question, first we have to look at some examples of each of them.
Some of the Ajax sites that we see are similar to the structure of non-Ajax sites, that is, composed of multiple pages, in general A view is a page, and non-Ajax site is only the introduction of the server side of the background communication, And these communication logic usually only serves the local area on the page. For example, a Community registration page, after entering the user name automatically in the background to query the server whether the user name has been used; for example, a book review site, after you have chosen the number of stars to indicate the rating of a novel, without refreshing the page will be able to save your choice backstage. These are server-centric AJAX applications, because the logic of these sites is mostly on the server side, must be implemented on the server side, but the client by introducing a background communication mechanism to increase the friendliness of users, reducing the user waiting for the page refresh time.
Other AJAX sites are different, such as Gmail and Pageflakes, which usually have only one or a few pages, most of which are performed on the client, and the server only works by providing data and performing a few operations that can cause a security breach on the client. These sites are called client-centric AJAX applications. Next we look at the common three models of client-centric AJAX applications.
Three models with client-centric
We all know that Ajax is simply using the XMLHttpRequest object to send a request to the server and then using the returned data to update the content on the page. Here, the data we can send and receive is in fact plain text, so the choice we can make is to send and receive data in what format.
Content-centric