ajax OPTION

function loadSTEEL_NUM(TYPEID){
var drp2 = $("drSTEEL_NUM");
drp2.options.length=0;
downloadUrl('BSOrder_STEEL_NUM.aspx?B_TYPEID='+TYPEID, function (xml, responseCode) {
var dom
if(document.all)//ie
{
dom=new ActiveXObject("microsoft.xmldom");
dom.loadXML(xml)
}
else if(window.DOMParser)//firefox
dom=new DOMParser().parseFromString(xml,"text/xml");
if(dom)
{
items1 = dom.getElementsByTagName("item");
var itemsLength=items1.length;
for(i=0;i <itemsLength;i++)                                                             
{
var newOption = document.createElement("OPTION");
newOption.text=items1[i].getAttribute("name");
newOption.value= items1[i].getAttribute("name");
drp2.options.add(newOption);
}
}
});

 


<items>
<item name="abc"></item>
</items>

你可能感兴趣的:(Ajax,xml,Microsoft,IE,firefox)