Analysis of Ajax controls and Class Libraries

Source: Internet
Author: User

There are too many Ajax controls and class libraries now. Without knowing it, I have added the mystery and complexity of Ajax. I will talk about my views on Ajax and hope that you will have 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. So I strongly suggest that, before learning Ajax, be sure to study some JavaScript, generally speaking, if you can smoothly understand prototype Framework Code such as: prototype-1.3.1.js ), your JavaScript level has basically passed. 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}

(

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.