Ajax is called "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML). It is a Web page development technology used to create interactive web applications. It organically includes the following technologies: Ajax (asynchronous javas Lifecycle + XML) Definition
Representation Based on the Web Standard (Standards-based presentation) XHTML + CSS;
Use dom (Document Object Model) for Dynamic Display and interaction;
Use XML and XSLT for data exchange and related operations;
Use XMLHttpRequest for asynchronous data query and retrieval;
Use javasCript binds everything together.
Ajax applications use Web browsers that support the above technologies as the operating platform. These browsers currently include Mozilla, Firefox, Internet Explorer, opera, Konqueror, and safari.
The Ajax application consists of three steps:
1. Creation object:
VaR XMLHTTP;
If (window. activexobject) // IE
{
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
Else if (window. XMLHttpRequest) // other browsers
{
XMLHTTP = new XMLHttpRequest ();
}
2. The response function after the request result is written:
XMLHTTP. OnReadystatechange = function ()
{
If (XMLHTTP. readystate = 2)
{
Window. Status = "submitting data ";
}
Else if (XMLHTTP. readystate = 3)
{
Window. Status = "data transfer in progress ";
}
Else if (XMLHTTP. readystate = 4)
{
If (XMLHTTP. Status = 200)
{
Window. Status = XMLHTTP. responsetext;
}
Else
{
Window. Status = "query error. Check whether the input is correct ";
}
}
Else
{
Window. Status = "querying ...";
}
}
3. Step 3: send a request
XMLHTTP. Open ("get", URL, true );
XMLHTTP. Send (null );
Reference case: http://www.51count.net/weather.htm
Now, you can write a new drop-down menu or a new message book or more advanced application.