<SCRIPT type = "text/JavaScript" Language = "JavaScript">
VaR http_request = false;
Function makerequest (URL ){
Http_request = false;
If (window. XMLHttpRequest) {// Mozilla, Safari ,...
Http_request = new XMLHttpRequest ();
If (http_request.overridemimetype ){
Http_request.overridemimetype ('text/xml ');
}
} Else if (window. activexobject) {// IE
Try {
Http_request = new activexobject ("msxml2.xmlhttp ");
} Catch (e ){
Try {
Http_request = new activexobject ("Microsoft. XMLHTTP ");
} Catch (e ){}
}
}
If (! Http_request ){
Alert ('Giving up cannot create an XMLHTTP instance ');
Return false;
}
Http_request.onreadystatechange = alertcontents;
Http_request.open ('get', URL, true );
Http_request.send (null );
}
Function alertcontents (){
If (http_request.readystate = 4 ){
If (http_request.status = 200 ){
Alert (http_request.responsetext );
} Else {
Alert ('There was a problem with the request .');
}
}
}
</SCRIPT>
<Span
Style = "cursor: pointer; text-Decoration: underline"
Onclick = "makerequest('test.html ')">
Make a request
</Span></P> <p> xmlns = "http://www.w3.org/1999/xhtml"> </P> <p> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "> <span style =" cursor: pointer; text-Decoration: underline "onclick =" makerequest ('test. XML ') "> <br/> make a request <br/> </span> <br/>