Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the essence of various Ajax controls and class libraries

Shulou Source: shulou.com Published: 2022-06-03 07:48:28 09月17日 Update

What is the nature of various Ajax controls and class libraries? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problems. Through this article, I hope you can solve this problem.

There are really too many Ajax controls and class libraries now, which unwittingly increases the mystery and complexity of Ajax. Seeing that many people in the version are puzzled and saddened by this, I decided to post this post to talk about my point of view on Ajax, hoping to let you have an essential understanding of Ajax.

Viewpoint 1: Ajax has nothing to do with server-side technology

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 from communication. In fact, no matter what Ajax technology it is, the server side is a plain text stream returned, and the client side processes the text. This text can be in xml format, a Html snippet, a JavaScript script, or just a string. The server is only used as a data interface, the client uses the XMLHttpRequest object to request the page, and the server writes the result text in the page, which is no different from ordinary web development. The only difference is that after the client gets the result asynchronously, it is not directly displayed on the page, but is processed by the client's Javascript script and then displayed on the page. As for the various controls that can return DataSet objects, Date objects, or other data types, they all encapsulate the results of this process.

Viewpoint 2: DOM model is the most essential technology of Ajax

The reason why XMLHttpRequest is not listed as the most essential technology, because I think it is too simple, it just allows the browser to request a page in the background and give its contents to JavaScript for processing. The real 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 div object, table object, and so on. The DOM model specifies the properties, methods, and events that these objects have. Through these properties, you can modify the content of a page that is already displayed in the browser, such as adding nodes, changing node locations, deleting nodes, and so on. It's not just an innerHTML attribute, although it's a useful attribute.

Point 3: understand the implementation of Ajax controls before using them

It is true that using Ajax controls can improve efficiency, but if you use controls like a castle in the air, the loss will outweigh the gain. Switching from one control to another has a long learning curve. So we should understand from the bottom, and Ajax is really not a sophisticated technology. In fact, the bottom of anything is actually simple, but if you encapsulate these bottom things, things will become complex and difficult to understand. Take Asp.net as an example, its customization feature allows it to be called an asynchronous method as long as it is preceded by a flag like [ajax method]. It is believed that this makes Asp.net 's Ajax development more "efficient" or "mysterious", while more things are encapsulated. Also keep in mind that any request to the server only returns plain text, and we don't have to rely on the encapsulated process, but we can implement it ourselves.

Viewpoint 4: learn JavaScript well

In the eyes of most people, JavaScript is not such a formal language. Any copy paragraph happens to run, and people like c can read it at a glance, and there are often script errors in browsers, so the subconscious feels that it can't take responsibility. In fact, to learn Ajax well, this is a completely wrong view. Javascript as a scripting language, its syntax is not very strict, but it does not prevent it from completing many complex tasks. Without JavaScript, there would be no Ajax. So I strongly suggest that before learning Ajax, be sure to study JavaScript, generally speaking, if you can smoothly understand the code of the prototype framework (such as: prototype-1.3.1.js), your JavaScript level will basically pass. At the same time, we can also have a basic understanding of the DOM model.

Viewpoint 5: Ajax embellishment: CSS

It is actually very simple to use JavaScript to control CSS. Basically every DOM object has a style object. As long as you remove the "-" from the css attribute and capitalize the following letters, you can use it as an attribute, for example: element.style.backgroundColor= "# f00"; in css, the selector {background-color:#f00}

I say so much in one breath. I hope it will be of some use to you ^ _ ^

After reading the above, have you mastered the essence of various Ajax controls and class libraries? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Controls objects clients technologies servers models viewpoints pages services essence clients properties text methods processing encapsulation content scripts processes complexity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Apple Docker Microsoft