local-storage

HTML5 Offline Storage with Android Browsers

梦想与她 提交于 2019-12-21 19:27:24
问题 I am investigating using an Android device for a website that needs to be usable offline. I have not been able to find much information on how the Android browser handles HTML5's localStorage and WebSQL. Does anyone know the size limit for these? Are they changeable (I know mobile Safari allows WebSQL to store up to 50mb if requested). Additionally, any good resources on the Android browser? I haven't been able to find anything good. Thanks. 回答1: There was a talk about client side persistent

Phonegap - Local storage not working - Android

£可爱£侵袭症+ 提交于 2019-12-21 15:10:06
问题 I'm using Local Storage to pass values between pages in order to create a scroll to effect (user clicks link and is scrolled to particular part of the page based on ID) I was previously using cookies but that didn't seem to work on Android, I read that local storage was supported so switched over to that. It works completely fine when in the browser but as soon as its packaged as a native app I lose all functionality? The API states that it should be supported, any ideas? Here's my code: Base

Does HTML5 localStorage maximum size include key names?

白昼怎懂夜的黑 提交于 2019-12-21 09:26:41
问题 HTML5's localStorage WebStorage has a maximum size of 5MB. Does this include the key names? For instance, if I were to use key names "quite-a-long-key-name-and-this-is-only-1" instead of "key1", would I run out of space sooner? On a slightly related topic; is there any de-facto convention for naming localStorage keys? How are namespace collisions prevented when using third party JS scripts? 回答1: Does this include the key names? Yes those do, they become part of data eg they identify data you

Why is localStorage[“…”] undefined, but localStorage.getItem(“…”) is null?

五迷三道 提交于 2019-12-21 09:16:21
问题 Last time I checked, the following two lines returned true : null == localStorage["foo"]; null == localStorage.getItem("foo"); Same applies when replacing null with undefined . So the first question is, why are there two ways to address the localStorage? And why does localStorage["foo"] return undefined while localStorage.getItem("foo") returns null ? Do I need to take care of that when developing JS? 回答1: The Web Storage Specification requires that .getItem() returns null for an unknown key.

HTML5 on iPhone Safari - data stored by localStorage does not always persist. Why?

时间秒杀一切 提交于 2019-12-21 09:14:02
问题 I write a simple iPhone web app using HTML5's localStorage. Tests on a 2G device show that data stored using localStorage does not persist after the Safari process is killed although the opened Safari windows are remembered. The data is also lost in a case where I am on a different site on a different Safari window, then I change the window to where the web app in subject is shown. When Safari loads the page it automatically refreshes the page. Then the data is lost. This is a simple test

Javascript localStorage and domains

落花浮王杯 提交于 2019-12-21 09:04:16
问题 Because iPad/iPhone doesn't support cookies from third party sites, I want to store values in localStorage. An example on domainA might be: <script src="http://domainB/something.js"></script> this script on domainB can access window.localStorage and it works great. However the values are stored in domainA because that's the document's location. If I put my script inside an iframe whose source is on domainB, then it works, but I'm trying to avoid frames. So my question is: Is there a way to

Javascript localStorage and domains

瘦欲@ 提交于 2019-12-21 09:04:12
问题 Because iPad/iPhone doesn't support cookies from third party sites, I want to store values in localStorage. An example on domainA might be: <script src="http://domainB/something.js"></script> this script on domainB can access window.localStorage and it works great. However the values are stored in domainA because that's the document's location. If I put my script inside an iframe whose source is on domainB, then it works, but I'm trying to avoid frames. So my question is: Is there a way to

localStorage updates between pages; works in FF 39.0 & Chrome 44, but not in Safari 8.0

萝らか妹 提交于 2019-12-21 06:46:13
问题 I've created an offline site consisting of 2 .html pages and 1 underlying .js page with the necessary functions (both html pages reference this js page): 1) edit.html is where an array of values is entered by the user in a simple html form and, upon Submit, stored in a JSON stringify-d localStorage variable ( "personList" ). The script then does window.location.href = "main.html"; which loads the other page. 2) main.html , in the body onload event, runs a function that first retrieves the

LocalStorage store not persisting on Android phone when app stops using Sencha Touch 2.2 and Phonegap

故事扮演 提交于 2019-12-21 06:08:09
问题 This is working fine in my browser but when I install the app on my phone and use it ... it looks fine UNTIL I force it to stop and reopen the app and then all my records are gone. Im using 2.2 and Phonegap.... any help would be VERY appreciated. Here is my store: Ext.define('MyApp.store.Presentations', { extend: 'Ext.data.Store', config: { model: 'MyApp.model.Presentations', sorter: 'title', grouper: function (record) { var upperCased = record.get('title')[0].toUpperCase(); return upperCased

How can I store a cookie in local storage with Javascript?

╄→гoц情女王★ 提交于 2019-12-21 05:14:21
问题 I have an app for Android (and hopefully later iPhone) that is based on Javacript and is made into an app using Phonegap/Applaud. Unfortunately, setting and getting cookies is not working on Android, and this might be particular to the Android environment. I was advised that using "local storage" might be more reliable. However, I knew nothing about local storage until this morning, and so I'm struggling to get aquainted. From what I gather, it's basically just another place to save data with