XMLHTTP Small manual, native AJAX reference manual

Source: Internet
Author: User

The individual does the Java EE Development, works in the general company, does is the general website.

1. If you often use frameworks such as jquery to make asynchronous calls, the main thing is not to understand how jquery is used, but to understand the HTTP protocol.

2. In order to understand the HTTP protocol, you can use the Firefox console F12, Google's console F12 view Responseheader,requestheader. Under IE, you can use HttpWatch Professional this tool.

3. If you want the system to understand the native Ajax request, you can visit the website XMLHTTP Small manual http://fireyy.com/doc/xmlhttp/xmlhttprequest.html

<HTML><Head><Scripttype= "Text/javascript">    varxmlHttp; functionloadxmldoc (URL) {xmlHttp=NULL; if(window. XMLHttpRequest) {//Ie7,firefox,opear, and other browsersxmlHttp=NewXMLHttpRequest (); }Else if(window. ActiveXObject) {//Ie5,ie6 BrowserxmlHttp=NewActiveXObject ("Microsoft.XMLHTTP"); }        if(XmlHttp!=NULL) {Xmlhttp.onreadystatechange=State_change; Xmlhttp.open ("GET", URLs,true); Xmlhttp.send (NULL); }Else{alert ("your browser does not support XMLHTTP"); }    }        //callback function called when the state changes    functionState_change () {//4--Loading Complete        if(Xmlhttp.readystate==4){            //--ok            if(Xmlhttp.status== $) {Document.getelmentbyid ("'). InnerHTML=Xmlhttp.status; Doucment.getelmentbyid (). InnerHTML=Xmlhttp.statustext; Doucment.getelmentbyid (). InnerHTML=Xmlhttp.responsetext; }Else{alert ('the fetch data XML error status is:'+xmlhttp.statustext); }        }    }    </Script></Head><Body>    <H2>Using the HttpRequest object</H2>        <P><b>Status:</b>    <spanID= "A1"></span>    </P>        <P><b>Status text:</b>    <spanID= "A2"></span>    </P>        <P><b>Response:</b>    <BR/><spanID= "A3"></span>    </P>        <Buttononclick= "Loadxmldoc (' Http://www.w3school.com.cn/example/xdom/note.xml ')">Get XML</Button></Body>

XMLHTTP Small manual, native AJAX reference manual

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.