<html>
<body>
<h1>The XMLHttpRequest Object</h1>
<p id="demo">Let AJAX change this text.</p>
<button type="button" onclick="loadDoc()">Change Content</button>
<script>
function loadDoc() {
var xhttp;
if (window.XMLHttpRequest) {
// code for modern browsers
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET.html", "ajax_info.txt", true);
xhttp.send();
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/xml/tryit.asp?filename=tryajax_xmlhttp_ie by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:56:10 GMT -->
</html>