Monday 8 April 2013

Ajax Call Program


<!DOCTYPE html>
<html>
<head>
<style>
#myDiv
{
width:700px;
}
</style>
<script>
function loadXMLDoc()
{
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","http://www.himansuit.com/shankarwcf/src1.svc/GetData",true);
xmlhttp.send();
}
</script>
</head>
<body>
<button type="button" onclick="loadXMLDoc()">Get Grid Data</button>
<div id="myDiv"></div>
</body>
</html>

No comments: