[jQuery] Re: Make list of unique json data?

2008-12-19 Thread alpha tester
Thanks very much for this Brian - got my head round it now! brian-263 wrote: > > > On Thu, Dec 18, 2008 at 4:49 AM, alpha tester > wrote: >> >> >> Hmmm... struggling to read from this new dataset using the code provided >> - >> can someone point out the stupidity in the following code: >>

[jQuery] Re: Make list of unique json data?

2008-12-18 Thread brian
On Thu, Dec 18, 2008 at 4:49 AM, alpha tester wrote: > > > Hmmm... struggling to read from this new dataset using the code provided - > can someone point out the stupidity in the following code: > > > > > var myData = > { records : [ > { CATEGORY : "Sport", TITLE : "The world of sport", LINK:

[jQuery] Re: Make list of unique json data?

2008-12-18 Thread alpha tester
Hmmm... struggling to read from this new dataset using the code provided - can someone point out the stupidity in the following code: var myData = { records : [ { CATEGORY : "Sport", TITLE : "The world of sport", LINK: "http://test.com"; }, {

[jQuery] Re: Make list of unique json data?

2008-12-18 Thread alpha tester
Amazing! Love the way you can take what was about 90 lines of javascript and turn it into about 5 of jquery and the jquery ends up being far more flexible! Thanks very much for your help! (do you know of any tutorials that cover this sort of dataset management stuff (push/group etc)) brian-26

[jQuery] Re: Make list of unique json data?

2008-12-17 Thread brian
On Wed, Dec 17, 2008 at 7:27 PM, Dave Methvin 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"; >

[jQuery] Re: Make list of unique json data?

2008-12-17 Thread Dave Methvin
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[rec

[jQuery] Re: Make list of unique json data?

2008-12-17 Thread brian
On Wed, Dec 17, 2008 at 9:49 AM, alpha tester wrote: > > > Hi I'm just learning JQuery and while I've got my head around the general > concepts, the real power of the logic it provides is still escaping me. > > I've got a page with a JSON dataset like this: > > var myData = > { records : [ > { CA