function GetSLEmailByID(controlID, pol_nbr)
{
var xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
try
{
document.getElementById(controlID).innerHTML = xmlHttp.responseText;
}
catch(e)
{
alert(controlID+"\n"+e.message);
}
}
}
xmlHttp.open("GET","slgetemail.aspx?pol=" + pol_nbr,true);
xmlHttp.send(null);
}
In this function, xmlHttp.onreadystatechange set a callback function, while xmlHttp.open("GET","slgetemail.aspx?pol=" + pol_nbr,true); initial the call of another page to get emails using a query string. So the whole content of the page will be parsed in the callback function and display the email.
No comments:
Post a Comment