AJAX XMLHttpRequest Object Detailed _ajax related

Source: Internet
Author: User

Ajax is a Web development technology that creates interactive Web applications and is a collection of asynchronous JavaScript and XML. At its core is the XMLHttpRequest object, which enables local updating of Web pages without submitting the entire page to the server, and is a key technology in the architecture of AJAX Web applications.
Basic properties:

Basic methods:

XMLHttpRequest Five step:
First: Create XMLHttpRequest objects
Second: Registering the callback function
Third: Setting parameters for server interaction
Four: Set the data sent to the server side, initiate and server-side interaction
V: Determine if the server-side interaction is complete, and whether the server side returns the 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 (); 
   Gets the current value, the get commits using 
   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 ();}} 
 

Summarize:

XMLHttpRequest is a core part of Ajax and needs to be understood well. At the beginning of contact, some do not understand what is going on, and the video is also the original Ajax, on the surface seems not very good understanding, but through the specific demo practice, it will be found in fact this quite easy to understand.

The above is the entire content of this article, I hope to help you learn.

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.