Hi Friends,
Please check this code where i was did wrong ? thanks in advance.
<button type="button" onclick='showData()'>Edit</button>
<script type="text/javascript">
function showData()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("emp_body").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","../xmlData/sample.php",true);
xmlhttp.send();
alert("Its Working");
}
</script>
The Alert code at the end of the code is displaying but the xmlhttp.open is not working.. please help