Detailed description of AJAX XMLHttpRequest object, ajaxxmlhttprequest
AJAX is a web development technology used to create interactive web applications. It is a collection of Asynchronous Javascript and XML. Its core is the XMLHttpRequest object, which enables partial update of webpages without submitting the entire page to the server. It is a key technology in AJAX Web application architecture.
Basic attributes:
Basic method:
XMLHttpRequest five-step method:
1. Create an XMLHttpRequest object
Second, register the callback function.
Third: set parameters for interaction with the server
Fourth, set the data sent to the server to start interaction with the server.
Fifth, determine whether the interaction with the server is complete, and determine whether the server returns correct data.
HTML code:
<! DOCTYPE html>
Code in aspx:
Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; namespace XMLHttpRequest five-step {public partial class XMLHttpRequest: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {// Response. clear (); // get the current value. Use get to submit the Request. queryString method // string username = Request. queryString ["username"]; // POST submission, using Request. form string username = Request. form ["username"]; Response. write ("Name: '" + username + "' <br/> time: '" + DateTime. now. toString () + "'"); Response. end ();}}}
Summary:
XMLHttpRequest is the core part of AJAX and needs to be well understood. Some of them didn't understand what was going on at the beginning, and the video was about native AJAX. On the surface, they didn't seem very easy to understand, but through specific demo practices, it is easy to understand.
The above is all the content of this article, hoping to help you learn.
Articles you may be interested in:
- How to process XMLHttpRequest objects that send multiple requests simultaneously in AJAX
- Ajax basics-XMLHttpRequest object Summary
- Description of the status value of Ajax xmlHttpRequest
- AJax learning note 1 (XMLHTTPRequest object)
- Jquery ajax learning notes 2 use the responseXML of the XMLHttpRequest object
- In php, XMLHttpRequest (Ajax) cannot set a custom Referer solution.
- Ajax communication principle XMLHttpRequest
- How to Use ajax to create an XMLHttpRequest object
- AJAX (XMLHttpRequest. status) status Code
- Resolve the compatibility problem between creating the ajax core XMLHTTPRequest object and the browser