posted 11 years ago
Hi All,
Here i'm posting one ajax doubt. Can anyone Please help me to find the solution?
Bellow i'm mentioning the code,
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function loadValues() {
var xmlhttp;
if(window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXobject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if(xmlhttp.readystate==4 && xmlhttp.status==200){
document.getElementById("mydiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","sijesh",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="mydiv"><h2>Let AJAX change this text</h2></div>
<button id="button_id" onclick="loadValues()"> Change Content </button>
</body>
</html>
Here I'm when executing this program ,i'm getting xmlhttp.readystate=NaN and xmlhttp.status=0 .Can anyone help me possible way to fix the issuse?
Thanks in Advance,
Best Regards,
Sijesh