Comments (1)
jStorage stores data as JSON. storageSize returns the string length of that JSON. If you get 2 then it means you have nothing stored and the result is for "{}"
. If you call flush, then it clears any possible stored data but it also resets internal metadata values to default values that are also stored inside the same JSON string, this is why you get 32 for the second call.
Storing 2.9MB to localStorage probably fails, as browsers support storing up to 5MB but this storage is for raw UTF-16 data which for you would mean about 2.5 MB on "normal" string. jStorage by design swallows all errors silently, in hindsight this is really bad but back in 2009 it seemed like a great idea as no one was actually storing that much data in browser anyway.
from jstorage.
Related Issues (20)
- Npm package update HOT 7
- what does jStorage based on ? cookie ? localstorage ? HOT 1
- JStorage Max Allowed Size in browsers HOT 2
- How to ignore subscribed publications for the current tab?
- Line 43: "detect a dollar object or create one if not found" - in some cases causes malfunctioning. HOT 2
- Works on IE 11, but needs server HOT 1
- TTL does not work HOT 1
- Update browser support page HOT 1
- the doc should not recommend to hotlink raw.github.com
- Uncaught TypeError HOT 2
- How to specify use session storage only? HOT 1
- Any idea to support changing the back end to sessionStorage HOT 1
- noConflict should have saved $.jStorage before blatting it
- JStorage does not give an indication it has run out of storage.
- Handle race conditions correctly HOT 2
- Publish/Subscribe does not work across tabs in iOS chrome
- Use jStorage inside Web Worker? HOT 1
- can we have application prefix for the keys/ main key (jStorage) HOT 6
- What is the scope of the data? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jstorage.