Internet Explorer Local Storage

I have an application that works fine on all browsers except IE. I am using a local database equipped with HTML5. I need to save 3 attributes for app users. I know that in IE I cannot use the database approach, and I was thinking about using 3 arrays stored in local storage, one array for each attribute. Is there a better (and easier) way to do this?

thanks

For example, I want to save 1) the destination 2) where they are from 3) the date So I thought that I would store an array for destinations, an array of locations and an array for dates. Then, using some id, I can index the arrays and get the relevant information.

+4
source share
3 answers

If you need local storage, you need local storage! Based on the information you describe, I think this is probably too hard to use in a session cookie.

Mark the documents . Keep in mind that only IE8 + is supported, so if you need to support other versions, you will need to do extra work.

I would personally enable localStorage where possible, then go back to the server circuit if the browser does not support it (and the data is certainly too much for cookies).

RE Polyfills Update

Keep in mind that the polyfiles offered by Rafael return to cookies if the browser does not support localStorage, etc. Be sure to check with good dissemination of data, and keep in mind that it will send all this data with each request (which has its own branches).

+2
source

For IE, you can use polyfill to simulate local local storage: https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

LocalStorage uses the key system: value. But you can save multiple data with one key using JSON.Stringify and JSON.parse.

+1
source

localStorage in IE does not work with this URL: File: /// P: /Dropbox/abc_web/ingrid8/ingrid.htm#car ..

via the network, if it works: File: //pedrojelp/p/Dropbox/abc_web/ingrid8/ingrid.htm#car ..

0
source

Source: https://habr.com/ru/post/1411165/


All Articles