var xmlHttpObj;
xmlHttpObj= CreateXmlHttpRequestObject();
function CreateXmlHttpRequestObject()
{
var xmlHttpObj;
if (window.ActiveXObject)
{
try
{
xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e)
{
xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
}
}
else
xmlHttpObj = new XMLHttpRequest();
return xmlHttpObj;
}
Then we need to call it from any aspx page TestAJAXOne.aspx as following...
into the TestScript.js file we need to add these following function
function MakeXMLHTTPSynchronousCall()
{
var xmlHttpObj;
xmlHttpObj= CreateXmlHttpRequestObject();
if (xmlHttpObj)
{
xmlHttpObj.open("GET","http://" + location.host + "/Test/EffectiveDateHAS.xml", false);
xmlHttpObj.send(null);
alert("Request/Response Complete.");
}
}
function MakeXMLHTTPAsynchronousCall()
{
var xmlHttpObj;
xmlHttpObj= CreateXmlHttpRequestObject();
if (xmlHttpObj)
{
xmlHttpObj.open("GET","http://" + location.host + "/Test/EffectiveDateHAS.xml", true);
xmlHttpObj.onreadystatechange= function()
{
if(xmlHttpObj.readyState == 4)
{
alert("Request/Response Complete.");
}
}
xmlHttpObj.send(null)
}
}