The JavaScript logics below doesn't display the value from the demo_get.txt in ajax.html. Did I do something wrong?
ajax.html
<HTML>
<HEAD>
<script type="text/javascript">
function ajaxRequest(){
var xmlhttp;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","demo_get.txt",false);
xmlhttp.send();
document.getElementById("panel").innerHtml = xmlhttp.responseText;
}else{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","demo_get.txt",false);
xmlhttp.send();
document.getElementById("panel").innerHtml = xmlhttp.responseText;
}
}
</script>
</HEAD>
<TITLE>AJAX EXAMPLE</TITLE>
<BODY onload="ajaxRequest()">
<div id="panel">Let Ajax alter this page</div>
</BODY>
</HTML>
demo_get.txt
HELLO AJAX APPLICATION