<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<Html>
<Head>
<Title> New Document </title>
<Meta name = "Generator" content = "EditPlus">
<Meta name = "Author" content = "">
<Meta name = "Keywords" content = "">
<Meta name = "Description" content = "">
</Head>
<Body>
<Script language = "JavaScript" type = "text/javascript">
<! --
// Create a browser-compatible XMLHttpRequest object
Var xmlhttp;
Try {
Xmlhttp = new ActiveXObject ('msxml2. xmlhttp ');
} Catch (e ){
Try {
Xmlhttp = new ActiveXObject ('Microsoft. xmlhttp ');
} Catch (e ){
Try {
Xmlhttp = new XMLHttpRequest ();
} Catch (e ){}
}
}
// Define the event handler of the XMLHttpRequest object
Xmlhttp. onreadystatechange = function (){
If (xmlhttp. readyState = 4 ){
If (xmlhttp. status = 200 ){
Alert (xmlhttp. responseText );
} Else {
Alert (xmlhttp. status );
}
}
}
// Create a connection
Xmlhttp. open ("get", "a.html ");
// Send the request
Xmlhttp. send (null );
// -->
</Script>
</Body>
</Html>
A.html:
Hello, ajax!