PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are developing an application that consumes an external web service that returns the latest stock rate.
The application has two methods:
The getResults() method makes an AJAX web service request
The ShowRate() method displays the stock rate from the web service response
You need to ensure that the ShowRate() method always displays the latest stock rate.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.

B.

C.

D.

4 Comments on “Which code segment should you use?

  1. oneskyp says:

    Well, I think the correct answer is D .. It must be synchronous since the method ShowRate is not being calling inside of the ajax success function… which means that it does not have a way to determine if the data was updated.. for that reason.. the call must be synchronous so as to way for the response and then use the showRate method with the data updated. Hope … it makes sense for you




    0



    0

Leave a Reply