0

Im really confused when thinking about my requirement to store data locally for offline viewing.Now i have two options,DOM storage and HTML5 Local storage. As im a complete newbiew in this particular topic,i need some help of SO Experts and Gurus. Whats the Advantage and Dis-advantage of these two.?can any one compare these one.,so that i can understand deeply or give some reference links?

2 Answers 2

3

DOM Storage or Web Storage is the collective name given to the following types of client storage options available in HTML5. It includes:

Local storage is persistent meaning the stored data will still be there when you close and re-open the browser window.

Session storage is temporary and is available as long as the page session lasts.

There is really no comparison between the two since technically they both are the same.

Sign up to request clarification or add additional context in comments.

4 Comments

so..if i want to store data,where will it be stored?as another file.?
looks like localStorage is what i want..what to do if i want to implement it?are we doing it in javascript?
yes, it's all in JavaScript and actually very easy to use. example - run this on some page - localStorage["hello"] = "world"; Close and reopen the page, and then try to access the value of localStorage["hello"]; It should return "world".
Im pretty sure the question is referring to localStorage['first-name']="anurag" vs something like <span id="first-name" data-first-name="anurag"></span>
1

Try to have a read here http://blog.sebarmeli.com/2010/11/22/understanding-webstorage/, you can easily understand the two objects, their methods, event attributes and their possible use.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.