AWebservicereturnsalistofsystemusersinthefollowingformat.Youneedtopopulateadrop-downmenuwiththeIDsandnamesoftheusersfromtheWebservice,intheorderprovidedbytheservice.Whichcodesegmentshouldyouuse?()A.$.ajax({type:"GET",url:serviceURL,success:function(xml){$

题目
AWebservicereturnsalistofsystemusersinthefollowingformat.Youneedtopopulateadrop-downmenuwiththeIDsandnamesoftheusersfromtheWebservice,intheorderprovidedbytheservice.Whichcodesegmentshouldyouuse?()

A.$.ajax({type:"GET",url:serviceURL,success:function(xml){$.each($(xml),function(i,item){$("").attr("value",id).text(tx).appendTo("#dropdown");});}});

B.$.ajax({type:"GET",url:serviceURL,success:function(xml){$(xml).find("user").each(function(){varid=$(this).id;vartx=$(this).name.text$("").attr("value",id).text(tx).appendTo("#dropdown");});}});

C.$.ajax({type:"GET",url:serviceURL,success:function(xml){$(xml).find("user").each(function(){varid=$(this).attr("id");vartx=$(this).find("name").text();$("").attr("value",id).text(tx).appendTo("#dropdown");});}});

D.$.ajax({type:"GET",url:serviceURL,success:function(xml){xml.find("user").each(function(node){varid=$(node).attr("id");vartx=$(node).find("name").text();$("").attr("value",id).text(tx).appendTo("#dropdown");});}});


相似考题