AJAX Javascript
Code
function initializeCate()
{
//debugger;
var xmlhttp;
if(window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readystate==4)//判断是否是完成状态
{
if(xmlhttp.status==200)//判断是否执行成功
{
var EnterpriseIDList=document.getElementById("HID").value;
if(EnterpriseIDList.length>0){
var CateNameList=xmlhttp.responsetext;
var ArrayID=EnterpriseIDList.split(",");
var CateName=CateNameList.split("|");
for(var i=0;i<ArrayID.length;i++){
document.getElementById(ArrayID[i]).innerHTML=CateName[i].length>13?CateName[i].substring(0,13)+"":CateName[i];
document.getElementById(ArrayID[i]).title=CateName[i];
}
}
}
}
};
xmlhttp.open("GET","GetCategoryNameByID.aspx?EnterpriseID="+document.getElementById("HID").value,true);
xmlhttp.send(null);
}
function initializeCate()
{
//debugger;
var xmlhttp;
if(window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readystate==4)//判断是否是完成状态
{
if(xmlhttp.status==200)//判断是否执行成功
{
var EnterpriseIDList=document.getElementById("HID").value;
if(EnterpriseIDList.length>0){
var CateNameList=xmlhttp.responsetext;
var ArrayID=EnterpriseIDList.split(",");
var CateName=CateNameList.split("|");
for(var i=0;i<ArrayID.length;i++){
document.getElementById(ArrayID[i]).innerHTML=CateName[i].length>13?CateName[i].substring(0,13)+"":CateName[i];
document.getElementById(ArrayID[i]).title=CateName[i];
}
}
}
}
};
xmlhttp.open("GET","GetCategoryNameByID.aspx?EnterpriseID="+document.getElementById("HID").value,true);
xmlhttp.send(null);
}