Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (22 sloc) 438 Bytes

jsonSelect

Created by Andriy Bazyuta.

Way to find a particular key's value in a JSON

Usage

HTML

data =
  a: "One"
  b:
    d: "Two"
    a: [
      a: "Tree"
    ,
      c: "Four"
     ]

Call

$.jsonSelect(data, "a");

Return

["One", "Tree", [Object { a="Tree"}, Object { c="Four"}]]

Dependencies

CoffeeScript for compilation to .js