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?
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?
can someone explain the answer D? why synchronous call?
author should review syntax.
Stijn, synchronous calling is necessary because the AJAX request needs to wait to a result that is displayed subsequently by the ShowRate() function.
Cache should be false as the stock rate should always be the most recent, hence the correct answer.
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