2
I have a list:
var dataString='[
{ "category" : "Search Engines", "hits" : 5, "bytes" : 50189 },
{ "category" : "Content Server", "hits" : 1, "bytes" : 17308 },
{ "category" : "Content Server", "hits" : 1, "bytes" : 47412 },
{ "category" : "Search Engines", "hits" : 1, "bytes" : 7601 },
{ "category" : "Business", "hits" : 1, "bytes" : 2847 },
{ "category" : "Content Server", "hits" : 1, "bytes" : 24210 },
{ "category" : "Internet Services", "hits" : 1, "bytes" : 3690 },
{ "category" : "Search Engines", "hits" : 6, "bytes" : 613036 },
{ "category" : "Search Engines", "hits" : 1, "bytes" : 2858 }
]';
where category
is a variant pattern that I care, I wanted to group these, the rest is non-standard variant that I do not care.
Group type an array of Business
in which I can go through all the business if I want and so on..
I liked your method for printing
JSON
in theDOM
html
, is public domain? I’ve used it in my answer. Hehe. And +1 for the answer.– Fernando Leal
@Fernando Como like this "public domain"... i used only browser features. Feel free to use where you want. =)
– Miguel Angelo
Yes, yes! I know, I was just referring to having used form
copy
paste
. But seriously now, the third parameter ofJSON.stringify
, did not know, very smart the resource.– Fernando Leal
I didn’t know either, I found out by producing this answer... by looking for a way to make JSON cute. Then I found out that the browser is already able to do this... cool right!
– Miguel Angelo