Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Window.LocalStorage on iOs
Message
From
23/11/2015 14:00:42
 
General information
Forum:
HTML5
Category:
Local storage
Miscellaneous
Thread ID:
01627762
Message ID:
01627817
Views:
37
>>
>>OK. I did the same type of thing on an app a few months ago. Couple of tips:
>>
>>You can add two eventlisteners to monitor online/offline status (works on Ipad Mini with Safari). I use that to disable/enable (and color code) a button which triggers sending/receiving data from the server. See: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine
>>
>>If the data structure permits I'd seriously consider using JSon objects rather than XML since it is far more compact and is probably what you will need for data on the client side. It's just as easy to have Web API return JSon as XML.....
>>
>>HTH,
>>Viv
>
>Ok; I can consider switching from using XML to Json; I just need to learn how to do it :). But another aspect that is a problem now (without WiFi) is as follows. Most of the pages (aspx) of the application use lookups (drop-down lists). for example, drop-down list of employees. This drop-down (in my application) lists are filled in LOAD method dynamically. Now I need to change it and instead of loading them (about 20 of them) dynamically, store them in a localStorage and then dynamically retrieve them from the local storage. Do you think this is practical/feasible?

Absolutely. But (and your not going to like me for this because it entails another technology :-} ) it is easiest when using a framework such as angularJs.
Using that you can populate a dropdown in HTML with something like:
<select  data-ng-model="vm.selectedThing" data-ng-options="l.Name for l in things"></select>
>
>When you say "have Web API return JSon", now comes a very newbie question (since I have not yet learned Web API), is Web API something that is installed on a tablet (iPad) or is it a URL to the server that calls some service running on the server?

WebAPI is in ASP.NET (i.e. Server side). If you sent a request to Web API from the client specifying 'Accept:application/json' in the headers the returned data will automatically be converted to JSon objects in the response. (For XML it's 'Accept: application/xml)


>Thank you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform