PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

DRAG DROP
You develop an HTML application that calls a web service to retrieve JSON data. The web service
contains one method named GetFullName that returns an Object named data. The data object
contains two properties named GivenName and Surname.
You need to load data from the web service to the webpage.
How should you complete the relevant code? (To answer, drag the appropriate code segment or
code segments to the correct location or locations in the answer area. Use only code segments that apply.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

6 Comments on “How should you complete the relevant code?

  1. Po says:

    The correct 1st code block should be “res”, not “res.data”.

    Even in ASMX webservice world and we wanted to get pedantic, the response payload would be placed inside a “d” property of res (so “res.d” would be acceptable). However nowhere should we make the assumption that invoking an as-described “web service” would return its payload in a “data” property.




    0



    0

Leave a Reply