-
-
- ".author .drinkPref :first-child"
-
- {
- "author": {
- "name": {
- "first": "Lloyd",
- "last": "Hilaiel"
- },
- "drinkPref": [
- "whiskey",
- "beer",
- "wine"
- ],
- },
- "thing": "JSONSelect site",
- "license": "(cc) BY-SA"
-}
-
- JSONSelect is an experimental selector language for JSON.
-It makes it easy to access data in complex JSON documents.
-It feels like CSS.
-Why not give it a try? -
-
- Current Selector (click to edit):
-
-{
- "name": {
- "first": "Lloyd",
- "last": "Hilaiel"
- },
- "favoriteColor": "yellow",
- "languagesSpoken": [
- {
- "language": "Bulgarian",
- "level": "advanced"
- },
- {
- "language": "English",
- "level": "native"
- },
- {
- "language": "Spanish",
- "level": "beginner"
- }
- ],
- "seatingPreference": [
- "window",
- "aisle"
- ],
- "drinkPreference": [
- "whiskey",
- "beer",
- "wine"
- ],
- "weight": 172
-}
-
-
-
- Choose A Selector...
- .languagesSpoken .language
- .drinkPreference :first-child
- .name > *
- .seatingPreference :nth-child(1)
- string:first-child
- ."weight"
- .language
- .favoriteColor
- string.favoriteColor
- string:last-child
- string:nth-child(-n+2)
- string:nth-child(odd)
- string:nth-last-child(1)
- :root
- number
- object
- string
-
-
- JSONSelect is dedicated to sad code everywhere that looks like this:
-if (foo && foo.bar && foo.bar.baz && foo.bar.baz.length > 2) - return foo.bar.baz[2]; -return undefined;-
It was created by Lloyd Hilaiel.
-Dave Herman provided the name, and lots of encouragement.
-Mike Hanson gave deep feedback and ideas.
-John Resig unwittingly contributed his design thoughts.
-The jsonselect.org site design was inspired by Stephen Wildish.
-JSON and CSS3 Selectors are the prerequisites to JSONSelect's existence, so thanks to you guys too.
- -
- Loading documentation...
-
-