```javascript var xhr = new XMLHttpRequest(); var name = document.getElementById("name").value; var age = document.getElementById("age").value; xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.status === 200) { document.getElementById("response").innerHTML = xhr.responseText; } else { // 处理错误情况 } } }; xhr.open("POST", "process_form.asp", true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.send("name=" + name + "&age=" + age); ```
```asp```