javascript - Json Data Structure Issue -
i list data following structure:
the datas published today: data1, data2, datas published yesterday: data1, data2
i data in json format. how json structure should data that?
the html structure is:
<div class="list dark"> <div class="item item-divider"> today </div> <a class="item item-avatar-left" href="#"> <img src="image"> <h2>tyrant</h2> <p>desc</p> </a> <a class="item item-avatar-left" href="#"> <img src="image"> <h2>tyrant</h2> <p>desc</p> </a> <div class="item item-divider"> yestarday </div> <a class="item item-avatar-left" href="#"> <img src="image"> <h2>data</h2> <p>desc</p> </a> </div>
the great thing json can structure want, in whatever way best suits needs. (assuming you're not consuming api that's out of control, of course).
will only displaying yesterday , today? if so, might want like:
{ "today" : { "image" : "url", "data" : "your data", "desc" : "description" }, "yesterday" : { "image" : "url", "data" : "your data", "desc" : "description" } }
or, if might have number of dates you'd want display, like:
{ "dates": [ { "date" : "2015-06-18", "image" : "url", "data" : "your data", "desc" : "description" }, { "date" : "2015-06-17", "image" : "url", "data" : "your data", "desc" : "description" } ] }
Comments
Post a Comment