local-storage

When a user closes a <div>, hide that <div> on all site pages

拟墨画扇 提交于 2019-12-18 03:01:36
问题 I've developed a couple of alert boxes that display on all site pages. The user is able to close each box separately: $(document).ready(function() { $("#close-alert-box-news").click(function() { $("#alert-box-news").hide(800); }); $("#close-alert-box-maintenance").click(function() { $("#alert-box-maintenance").hide(800); }); }); .alert-box { width: 50vw; position: relative; margin: 20px auto; border: 1px solid black; } .alert-box-close { position: absolute; top: -12px; right: -12px; cursor:

HTML5 localStorage & SQL

拥有回忆 提交于 2019-12-18 02:48:40
问题 I understand that HTML5 "localStorage" is a key:value store but I am wondering if there is a Javascript library available that offers a more SQL-ish API? 回答1: Check out Will HTML5 be SQL-free? and DOM Storage: a Cure for the Common Cookie for some links and opinions. 回答2: W3C Database specification says: User agents must implement the SQL dialect supported by Sqlite 3.6.19. As of now, at least Google Chrome supports SQL dialect. I have checked myself. 回答3: You should use HTML5 database

Import/Export HTML5 localStorage data

旧街凉风 提交于 2019-12-17 23:18:07
问题 I'm working on a simple TODO list app based on localStorage HTML5 feature: http://hamen.github.com/webnotes/ I'm wondering if it's possible to import/export data in some way. How could I provide an "Export note/Import note" feature to make users being able to save their note on their HD and import them in another browser profile? Thanks 回答1: I think you can use the "HTML File API" to load from file and a "Data URI" (http://en.wikipedia.org/wiki/Data_URI_scheme) to save. 来源: https:/

localStorage and 'file:' protocol not persistent, SQLite gives SECURITY_ERR

余生长醉 提交于 2019-12-17 20:53:23
问题 Introduction I work with RapidWeaver — Mac OS X CMS application — and it uses no server environment. It has an editor and a preview mode. The preview mode is a Webkit based renderer, and I can use 'Inspect Element', like you normally could do in Safari. I want to store some settings for a toolbar, either using localStorage or SQLite . I have read some information about indexedDB, though I have found no concrete implementations on how to use it. Problems with localStorage localStorage works

localStorage not working in Edge?

坚强是说给别人听的谎言 提交于 2019-12-17 19:48:23
问题 I am currently working on a some JS. It works fine in every browser apart from Microsoft Edge. The issue is quite simple: at the beginning of one of my scripts I declare a variable like so: var something = localStorage.getItem('something'); Anyway the something doesn't exist yet, but the whole idea is that this can be used for reference in a later function. Firefox, Chrome, Opera and Safari don't have a problem with this but Edge does, so my question is, is the a quick fix? Or am i going to

localStorage.getItem returns old data in IE 9

一曲冷凌霜 提交于 2019-12-17 19:25:06
问题 The following example needs to be running in IE 9 and in at least two different tabs. <input type="text" name="data" value="" placeholder="change me" id="data" /> <p id="fromEvent">Waiting for data via <code>storage</code> event...</p> <script type="text/javascript"> window.addEventListener("storage", function (e) { if (e.key == 'storage-event-test') { var newValue = localStorage.getItem('storage-event-test'); // returns old value // var newValue = e.newValue; // returns new value $('

How large is HTML5 session storage?

荒凉一梦 提交于 2019-12-17 18:45:16
问题 Although the size of localStorage has been addressed in detail and there is a online test for it, I was wondering what the maximum size of sessionStorage is for the common browsers? 回答1: According to this site, Firefox’s and Safari’s storage limit is 5MB per domain, Internet Explorer’s limit is 10 MB per domain. However, according to this site which tests your web browser local storage capabilities, on my machine: Browser LocalStorage SessionStorage ------- ------------ -------------- Chrome

PHP & localStorage; [closed]

≯℡__Kan透↙ 提交于 2019-12-17 18:36:44
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I've searched around for use of localStorage in PHP, as I need to get localStorage data as a $var, in PHP and do stuff in PHP with it. Is this possible? P.S. If anybody knows any good HTML5 resources, other than

Save data to local storage

做~自己de王妃 提交于 2019-12-17 16:07:38
问题 I'm trying to set a bush of variables in local storage but the function doesn't run, I've tried to get the value but without luck, How can I save fields in Local storage? function setPerson(){ var person = { 'name': getElementById('name'), 'photo': getElementById('photo')}; // Put the object into the storage alert(person); localStorage.setItem('person', JSON.stringify(person)); }; HTML In the HTML I'm from fields put values into tags and they are populated, but when I try to fetch them and

Protractor - empty local storage

China☆狼群 提交于 2019-12-17 13:51:06
问题 I'm using Protractor (with Jasmine) to test my AngulaJs application. As result of some of my action I get some data saved in the localStorage. Now I need to test other case, so I need to empty my storage (or better delete only some items) but If I try to run: browser.executeScript('localStorage.removeItem("config");'); I get the following error: UnknownError: <unknown>: Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs. (Session info: chrome=35