Page 1 of 1

localstorage.getitem('myLocalJSONArrayofObjects')

Posted: Tue Jun 04, 2013 2:08 pm
by doubletake

I have a JSON result (Array of Objects), which is a list of venues that comes back in my search results from FourSquare API. I store the venues in localStorage so that I can access them on another screen.

How "Should" I be storing and getting JSON Array of Objects so that I can loop through it with $.each?

var myvenuedata = localstorage.getitem('myLocalJSON')

$.each(myvenuedata, function(index, value) {
alert(lat: ' + value.location.lat);
});

Or is there a better approach to storing and accessing data on multiple screens?

Thanks,
Don

Image


localstorage.getitem('myLocalJSONArrayofObjects')

Posted: Tue Jun 04, 2013 3:09 pm
by doubletake

I think I found an answer about using stringify first at very bottom of this page
http://docs.appery.io/documentation/a...


localstorage.getitem('myLocalJSONArrayofObjects')

Posted: Tue Jun 04, 2013 8:25 pm
by Kateryna Grynko

Hi Don,

Yes, you're right. Just to add. In localStorage you can store a string only.