This section introduces (asynchronous linked server object) XMLHttpRequest and an introduction to Ajax.
Ajax is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML). AJAX has four benefits: 1. That reduces the burden on the server. 2 brings a better user experience. 3. Standards-based support is widely available. 4. Have better page rendering and data separation.
| Technical name |
Technical notes |
| Javascript |
JavaScript is a generic scripting language, and Ajax is written in JavaScript. |
| Css |
User interface styles are modified by CSS |
| Dom |
Dom modifies dom,ajax through JavaScript to change the user interface at run time, or to partially update a node in a page. |
| XMLHttpRequest |
The XMLHttpRequest object XMLHttpRequest object allows web programmers to retrieve data from the Web server in the background. The number of data is usually either XML or text. |
From the above we can see that JavaScript is like glue to paste the various parts together, for example, through the JavaScript operation BOM change Refresh user interface, modify the classname to change the style of CSS style
Not strictly speaking, Ajax is a simple multi-threaded, it can be a user in the foreground a variety of operations without interruption. Ajax asynchronous interactions work silently in the background the asynchronous access in the Web is implemented by the XMLHttpRequest object, which was first introduced as an ActiveX control in IE5. Then each browser supports the asynchronous object, and the object must first be created. The code is as follows:
var xmlHttp; function Createxmlhrrprequest () { if (window. ActiveXObject) xmlHttp = new ActiveXObject ("Microsoft.XMLHTTP"); else if (window. XMLHttpRequest) xmlHttp = new XMLHttpRequest (); }
The object is first created with a global variable, XMLHTTP, to be used later in the function. Also create asynchronous object function Createxmlhrrprequest ()
This procedure uses the If statement method, if IE uses the Window.activexobject method, if not, the XMLHttpRequest method is used to create the function.
After the asynchronous object is created, it is natural to use the object to connect to the server, which has a series of very useful properties and methods.
(not to be continued)
Ajax (i) Introduction and basics of Ajax