<script>
var xhr = new XMLHttpRequest();
xhr.open("GET","ajax.do",true);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200){
var h = document.getElementById("h");
h.innerHTML = xhr.responseText;
}
};
xhr.send();
</script>
</head>
<body>
<h1 id="h"></h1>
</body>
//四个步骤