문제

The standard

localStorage.var = var;

Isn't working for me, for example:

localStorage.library_science1.owned = library_science1.owned;

Where library_science1 is a previously created Object with the 'owned' property. Can anyone please help?

올바른 솔루션이 없습니다

다른 팁

Local storage only handles Strings. Use JSON.stringify(library_science1) before you store, and JSON.parse(localStorage.library_science1) when you read from localStorage.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top