PDA

View Full Version : How can i check if localstorage is empty?



slmd
31 Oct 2011, 8:50 AM
Hello!

I have datas i save in the device localstorage and i am using XTemplates for the layouts. I am thinking of showing a text saying there is no data when the localstorage is empty. Is there any method that i can use? How can i achieve this?

Thank you

jep
10 Feb 2012, 7:33 PM
There's localStorage.length. But it kind of depends on what you want to do.