ess
ess

Reputation: 683

how to create a html file to store offline data

I want to create a web page so that it can store some data offline. I want to use this file in tablets as well as smart phones. can any body suggest some offline data storage for HTML and also its examples and tutorials. I have Googled about websql in html5. But didn't get any simple answer.

Upvotes: 3

Views: 910

Answers (1)

ZeroBased_IX
ZeroBased_IX

Reputation: 2727

If you're using HTML 5 here's an example pulled from W3Schools:

// Store
localStorage.lastname = "Smith";
// Retrieve
document.getElementById("result").innerHTML=localStorage.lastname;

[Source]: W3Schools

For a more comprehensive guide visit DiveintoHTML5

Or here: http://www.html5rocks.com/en/features/storage You have three main choices for storage:

  • Name/Pair Storage within the browser (see the W3 link)
  • IndexedDB [Source]
  • Web SQL DB [Source]

I hope you find the best solution for your project!

Upvotes: 1

Related Questions