There are too many Ajax controls and class libraries now. Without knowing it, the mystery and complexity of Ajax have been added. Many people in the version are puzzled and worried about this, I decided to post this post to talk about my views on AJAX, hoping to give you an essential understanding of Ajax.
Viewpoint 1: Ajax and server-side technology are irrelevant
Strictly speaking, compared with traditional web development, Ajax is a complete Client technology. Because many controls encapsulate the communication process between the client and the server, many problems also arise due to communication. In fact, no matter what Ajax technology is, the server side returns a pure text stream, which is then processed by the client. The text can be in XML format, HTML snippets, JavaScript scripts, or strings. The server is just a data interface. The client uses the XMLHTTPRequest object to request this page. The server writes the result text to the page. This process is no different from that of common web development. The difference is that after the client asynchronously obtains the result, it is not directly displayed on the page, but is processed by the client's Javascript script and then displayed on the page. The so-called DataSet object, date object, or other data types returned by various controls encapsulate the results of this processing process.
Viewpoint 2: Dom model is the most essential technology of AJAX
The reason why XMLHttpRequest is not listed as the most essential technology is that I think it is too simple. It only allows the browser to request a page in the background and send its content to JavaScript for processing. The true core should be the DOM model, that is, the Document Object Model. In the DOM model, HTML tags are considered to be an object, such as a div object or a table object. The Dom model defines the attributes, methods, and events of these objects. Through these properties, you can modify the content of a page that has been displayed in a browser, such as adding nodes, modifying node locations, and deleting nodes. It is not just an innerhtml attribute, although it is a very useful attribute.
Viewpoint 3: understanding their implementation before using Ajax controls
The use of Ajax controls can indeed improve efficiency, but if you use controls like a castle in the air, it will be worth the candle. Switching from one control to another has a long learning curve. Therefore, we should understand it from the underlying layer. Besides, Ajax is not an advanced technology. In fact, the bottom layer of everything is actually simple, but if these underlying things are encapsulated, things will become complicated and hard to understand. Taking Asp.net as an example, its custom features can be called an Asynchronous Method by adding a sign like [Ajax method] before a method, I believe this makes Asp.net's Ajax development more "efficient" or "mysterious", and more things are encapsulated. Remember the same one. Any request to the server only returns plain text. We do not have to rely on encapsulated processing, but can implement it by ourselves.
Opinion 4: Learn Javascript
In most people's opinion, JavaScript is not such a formal language. Anyone who has learned C can understand it at a glance, in addition, there are often Script Error prompts in the browser, so the subconscious feels that it cannot take too much responsibility. In fact, it is totally wrong to learn Ajax well. Javascript, as a scripting language, does not have very strict syntax, but does not prevent it from completing many complex tasks. Without JavaScript, there is no Ajax. Therefore, I strongly recommend that you study JavaScript before learning Ajax. Generally, if you can understand the prototype frameworkCode(Such as: prototype-1.3.1.js), your JavaScript level is basically pass. At the same time, you can have a basic understanding of the DOM model.
Opinion 5: Ajax embellishment: CSS
Using JavaScript to control CSS is actually very simple. Basically, each DOM object has a style object, as long as the "-" in the CSS attribute is removed, and the subsequent letters can be used as attributes, for example, element. style. backgroundcolor = "# f00"; in CSS, select {background-color: # f00}
if you say so much in one breath, I hope it will be helpful to everyone.