the XMLHTTPRequest object is used to send HTTP requests to the server in Javascript. Other libraries such as jquery should encapsulate HTTP requests on this object, use the following statement to create an xmlhtprequest object:
Function createxmlhttprequest () {var XMLHTTP; If (window. XMLHttpRequest) {XMLHTTP = new XMLHttpRequest (); If (XMLHTTP. overridemimetype) XMLHTTP. overridemimetype ('text/xml');} else if (window. activexobject) {try {XMLHTTP = new activexobject ("msxml2.xmlhttp");} catch (e) {try {XMLHTTP = new activexobject ("Microsoft. XMLHTTP ") ;}catch (e) {}} return XMLHTTP;} sends a GET request and Asynchronously processes XMLHTTP = createx Mlhttprequest (); var url = "getfiledetail. jsp? Fileid = "+ ID; XMLHTTP. open ("get", URL, true); // XMLHTTP is returned for asynchronous processing. onreadystatechange = callback; XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded;"); XMLHTTP. send (); send POST request var url = "getnginxstatus"; XMLHTTP. open ("Post", URL, true); XMLHTTP. onreadystatechange = getstatusback; XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded;"); XMLHTTP. send (XML );