News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
<xml version="1.0" >
<users>
<user id="first">
<name>Name of first user</name>
<email>first@contoso.com</email>
</user>
<user id="second">
<name>Name of second user</name>
<email>first@contoso.com</email>
</user>
</users>

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?

  1. $.ajax({
    type: "GET",
    url: serviceURL,
    success: function(xml) {
    $.each($(xml), function(i, item) {
    $("<option>").attr("value", id)
    .text(tx).appendTo("#dropdown");
    });
    }
    });
  2. $.ajax({
    type: "GET",
    url: serviceURL,
    success: function(xml) {
    $(xml).find("user").each(function() {
    var id = $(this).id;
    var tx = $(this).name.text
    $("<option>").attr("value", id)
    .text(tx).appendTo("#dropdown");
    });
    }
    });
  3. $.ajax({
    type: "GET",
    url: serviceURL,
    success: function(xml) {
    $(xml).find("user").each(function() {
    var id = $(this).attr("id");
    var tx = $(this).find("name").text();
    $("<option>").attr("value", id)
    .text(tx).appendTo("#dropdown");
    });
    }
    });
  4. $.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();
    $("<option>").attr("value", id)
    .text(tx).appendTo("#dropdown");
    });
    }
    });
Answer: Answer is c
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;