Friday, 26 December 2014

AJAX code not running



I review this code for many time but I don't know where it is problem : http://ift.tt/1wrOx8L



<html>
<head>
<script type = "text/javascript">
function load(){
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else{
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}

xmlhttp.onreadystatechange = function (){
if(xmlhttp.readyState == 4 && xmlhttp.status == 200 ){
document.getElementById('adiv').innerHTML = xmlhttp.responseText;
}

}
xmlhttp.open('GET','inculde.inc.php',true);
xmlhttp.send();
}
</script>
</head>
<body>
<input type="submit" onclick = "load();">
<div id ="adiv"></div>
</body>
</html>


I run it in any browser but nothing happen .


No comments:

Post a Comment