doba
doba

Reputation: 25

Windows Phone phonegap/cordova localstorage not saving data

I have problem with localStorage in phonegap. There are two types of notation in localStorage:

1. localStorage.setItem["key", "value"]/localStorage.getItem["key"] (not working for me)
2. localStorage.key (works fine, but not saving data, after relaunch application)

Upvotes: 0

Views: 1054

Answers (2)

最白目
最白目

Reputation: 3654

are you using the square brackets? You´re setting up an array instead of calling a function.

try this:

localStorage.setItem("key", "value");

//get the value
localStorage.getItem("key");

Upvotes: 2

user
user

Reputation: 1001

My personal suggestion would be don't use the local storage.Its not good for the long run,as it is almost deprecated and has a limitation in the storage size.

Use a plugin and adapt SQLITE database or anything that would not have restriction on the size of storage.

Upvotes: 0

Related Questions