What gives us the technology. The development WEB applications seeking to distinguish between client and server, and it comes from the widespread use of templates, such as Smarty and XSLT. The projects are becoming more complex and bind the different technologies become far too expensive for the developer. For example, all formatting styles are made in CSS or XSL files, HTML and XML data stored elsewhere, in the third handler server, database in the fourth. And if even 5-6 years ago almost everywhere could see the interlocking whole in a single file, it would become increasingly rare.
If a more complex projects there is a need for structure and readability of the code. Do not litter code programmer code Imposer and Imposer code-flattening designer, and so on.
So what is AJAX? For the first time since moving to Ajax in February opened a year article Jesse James Garrett (Jesse James Garrett), "Rethinking the Web." Ajax is not independent technologies. This idea, which is based on two basic principles.
Using DHTML to the dynamic changes of this page.
Using the XMLHttpRequest to contact the server on the fly.
Using these two approaches to create a much more user-friendly WEB-interfeysy page, where interaction with the user. Using Ajax is the most popular after Google started to use it in their sites like Gmail, Google maps and Google suggest. The creation of these sites has confirmed the effectiveness of this approach.
So more : taking classical model WEB-prilozheniya :
Customers dial a search, address issues of his life, coming into contact with the server, it makes a request. The server performs the calculation in accordance with the request, calls to the database, and so on, after which the data are customers and, if necessary inserted in the templates and processed browser. The result is a page that we see, and that 80% of the population at the WEB called the Internet. This is a classic model, which has already proved himself and earned an honoured place in the sun. This is the simplest model of interaction and consequently the most common. But it is increasingly becoming insufficient. Imagine, on-line game "Ships", which played two hard-resident friend of South Africa and a resident of Japan. As with the model to make their game the most fun? In any case sunken ships will be stored on the server, and that would not verify whether the opponent looked like, need to be updated every time the page and podguschat outdated data. "But people come caching" - and you will say absolutely right, but more is not going to be. Caching only accelerate time interaction with the server, but does not eliminate the need to reload the page. Alternatively, you can put some time itself, but in this case the page will be completely reset.
Now look at the model of interaction AJAX :
The sequence of a client and it will likely not understand what would happen, and the word AJAX will be associated only with the name of the football club. But on the server side, all is not true.
When a server generated page, which will show you, and invite them to his interest sequenced. When informed (though not necessarily) a choice the client, its request will be treated to AJAX module, which will be of interest to all its computing and the server itself. But where is the innovation? The main difference in terms of this method enables us to dynamically access the server and perform actions interest us. For example, we need to appeal to the database and receive data of interest to us then we will use. The data we store in the XML file to be built dynamically, thus :
Generating pages, we are creating unique values, which then placing variables in the server. And Cookies browser, and then when we get authorization username and password that we need to allocate processing module on the server.
Once the user data and clicked Submit his password entered into Cookies, and the user name is a reference open-http://www.mubestajax.com/ajax.php?login=pupkin example, when the data server in the first place a check of the data. Because the values that we have generated at the beginning of the server and then give them a global server variables and cookies must match, then verify the integrity of data transferred in the event of incompatibility program stops working. If all went well, then retrieved all the necessary data and the necessary calculations and work. This type of protection is fairly simple and effective. But for large projects, it did not come.
When a formulation of a security, better use of more sophisticated and reliable solutions. But in most cases, these precautions will be more than enough as the use of more complex modules using a technology that is not always part of the standard software of modern servers, the main feature of which is easy. This is the technology such as MySQL and PHP have become so prevalent because they provide easy work with its low resource consumption and little credibility. And to this software in the best possible approach to the above proposed.
In conclusion I would like to say that AJAX on the one hand, a huge leap in WEB engineering, but on the other hand this is a long standing stage of evolution, which opened new horizons in the field of software development. At the same time, this technology is still "cheese" because of its use at the moment rather pleasant exception. But I am sure that it is not yet time to hear everything.