jquery - JSON formatting for 3 layer nest -
jquery - JSON formatting for 3 layer nest -
i trying accomplish jquery code automatically fills in select box name , id next select box (if logic correct). having issues structuring json file.
i have next attributes requires 3 layer nested json:
static element (first thing on html page)
<select> <option value="first">this first</option> <option value="second">this second</option> <option value="third">this third</option> <option value="fourth">this fourth</option> <option value="fifth">this fifth</option> </select>
so have 1 static element user has select first option
{ "first":[ "london"[ "id" = "london" "name" = "london uk" { "id" = "firstlondon", "name" = "first london" }, { "id" = "secondlondon", "name" = sec london } ] ] }
so logic client select first
element static select box, display sec layer of json file, london
(i need id , name generated can populated within next select option). finally, when person selects location, displays 3rd json.
i have worked out jquery, not how formulate json.
the next valid json formatted illustration gave. have know little bit more info in order understand if proper representation of data.
i utilize jsonlint if crazy json or long files, helps me see what's going on. i'd recommend running info through here, catches missing brace or bracket , helps if miss comma in experience.
{ "first": [ { "london": [ { "id": "london", "name": "london uk", "london": [ { "id": "london", "name": "london uk" }, { "id": "secondlondon", "name": "second london" } ] } ] } ], "second": [ { ... } ] }
jquery json
Comments
Post a Comment