多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

A Web service returns a list of system users in the following format. You need to populate a drop-down menu with the IDs and names of the users from the Web service, in the order provided by the service. Which code segment should you use?() 

  • 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() { var id = $(this).id;  var tx = $(this).name.text $("").attr("value", id).text(tx).appendTo("#dropdown"); }); } });
  • C、$.ajax({ type: "GET", url: serviceURL, success: function(xml) { $(xml).find("user").each(function() { var id = $(this).attr("id"); var tx = $(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) {  var id = $(node).attr("id"); var tx = $(node).find("name").text(); $("").attr("value", id).text(tx).appendTo("#dropdown"); }); } });
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题