这是JS
//商品大类小类的级联
function getChildType(){
// var parentName=document.getElementById("parentName").value;
var parentName=document.search.parentName.options[document.search.parentName.selectedIndex].value;
sendParentType("getChildTypeServlet?parentName="+parentName);
}
function sendParentType(url){
createXMLResponse();
xmlHttpreq.open("get",url,true);
xmlHttpreq.onreadystatechange=getResponse;
xmlHttpreq.send(null);
}
function getResponse (){
if(xmlHttpreq.readyState==4){
if(xmlHttpreq.status==200){
var text=xmlHttpreq.responseXML;
var childName=text.getElementsByTagName("childName");
var childNameSelect=document.search.childName;
childNameSelect.length=childName.length;
for(var i=0;i<childName.length;i++){
// alert(childName[i].childNodes[1].firstChild.nodeValue);
childNameSelect.options[i].text=childName[i].childNodes[0].firstChild.nodeValue;
childNameSelect.options[i].value=childName[i].childNodes[1].firstChild.nodeValue;
}
}
}
}