Hello,
Welcome to our Microsoft Q&A platform!
I can provide an idea to solve your problem:
- Create
getDataFromWeb()
andgetDataFromLocal()
methods instead of the generalgetData()
method. - Create a global variable, assuming the variable name is
totalData
. - First call
getDataFromLocal()
to assign the obtained value tototalData
, and then continue to callgetDataFromWeb()
. If the value is obtained, assign the new value tototalData
. - Display the content of
totalDat
a on the UI by binding.
Here are some documents that might be helpful:
---
From the code you provided, the programming language you may use is Javascript
. If so, you need to know Javascript about how to create Ajax
requests.
Thanks.