Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Date: Mon, 7 Feb 2011 23:56:39 +0900
- From: Raymond Wan <rwan.kyoto@example.com>
- Subject: Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- References: <4D4E75AB.5060703@example.com> <87aai91c4o.fsf@example.com> <4D4F65F2.1060000@example.com> <87sjw0z3g8.fsf@example.com> <4D4FF8AB.3090809@example.com>
Hi Dave, On Mon, Feb 7, 2011 at 10:50 PM, Dave M G <dave@example.com> wrote: > Stephen, Josh, Fredric, Raymond, ,,, > If I can get JSON to look at this as an array, not an object, I think I > can do something like this: ... > > Can anyone break it down to me on my lower-than-noob level? As I said, I haven't written any Javascript before and know nothing about JSON -- first time hearing about it. But it sounds like you could convert JSON data into an object via a parser [1]. I don't know where to get one, but it sounds like there is one in Javascript already [2]. And then you can sort it using examples here [3]. Given what you have isn't a text file, perhaps you can skip to the sorting? From reading these pages, it sounds like objects in this sense aren't lined up in an array as what I'm use to in some languages. Seems like they are calling an array an object...which sort of explains what you meant in your first post... In C++, array (vector) can hold objects but the array itself has methods like foo.size () which returns the number of objects stored in the array. I suppose what Javascript is doing with the JSON data is something similar? That is, the array is an object where you can call sort function on... Just a guess... Also sounds like JSON is a data format and you're not required to use Javascript... Hope this helps a bit... Ray [1] http://en.wikipedia.org/wiki/JSON (End of "Data types, syntax and example") [2] http://www.json.org/js.html [3] http://stackoverflow.com/questions/979256/how-to-sort-a-json-array
- References:
- [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Dave M G
- [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Stephen J. Turnbull
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Dave M G
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Stephen J. Turnbull
- Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Next by Date: [tlug] Importing WiFi equipment
- Previous by thread: Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Next by thread: Re: [tlug] [Javascript] Shouldn't there be a sort option on objects
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links