HTML5 local storage JSON multiple objects <p>Does anyone know, if it's possible to make a local storage with multiple objects in it when I'm doing a loop in javascript?</p> <p>At the moment my code looks like this: </p> <pre><code>var albums = ''; var album_list = ''; $.each(data, function(i,item){ var name = item.name; albums += '&lt;li&gt;'+item.name+'&lt;/li&gt;'; var album_content = {name: item.name, uid: 1}; var album_content = album_content+','; album_list += album_content; }); var album_list = '['+album_list+']'; localStorage.setItem("albums", JSON.stringify(album_list)); var albums_l = JSON.parse(localStorage.getItem("albums")); $.each(albums_l, function(i,item){ console.log(item.name); }); </code></pre> <p>But that gives me an error. Anyone have a better solution for this, so I just have one localstorage and all the data in that?</p>