On Wed, Dec 17, 2008 at 7:27 PM, Dave Methvin <dave.meth...@gmail.com> wrote: > > It might be worthwhile to generalize it and just push the original > JSON record onto the list. That way the code doesn't need to change if > you later need to pass more than title and link. > > var categories = {}, groupBy = "CATEGORY"; > $.each(myData.records, function(i, record) > { > if (!categories[record[groupBy]]) > categories[record[groupBy]] = []; > categories[record[groupBy]].push(record); > }); >
Good tip!