exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 3 discussion

Actual exam question from Microsoft's 70-480
Question #: 3
Topic #: 2
[All 70-480 Questions]

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?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
" always displays the latest stock rate ". Should use cache: false
Note: cache (default: true, false for dataType 'script' and 'jsonp')

Type: Boolean -
If set to false, it will force requested pages not to be cached by the browser.
Reference: jQuery.ajax()

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
dr_0verboost
4 years, 8 months ago
D is the right answer boyo!
upvoted 2 times
...
mohmou
4 years, 9 months ago
I think it should be D "Setting cache to false will only work correctly with HEAD and GET requests" Source: https://api.jquery.com/jquery.ajax/
upvoted 2 times
...
danhan
5 years, 7 months ago
hi, no, D is the correct answer. When you have type="POST" then cache can be set to true.
upvoted 1 times
...
rlutigneaux
5 years, 7 months ago
I think the good answer is B because when the type is POST the cache attribute doesn't exist
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...