javascript - Find all parents elements in a Json file using jQuery -


i'm working on recursive menu built on top of jquery looks quite already.

the structure of json file containing menu looks following:

[    {         "id": "menuofficewebcontrolsforwebapplication",         "title": "office web controls",         "resource": "/documentation/data/index.html" },    {         "id": "menugettingstarted",         "title": "getting started",         "resource": "/documentation/data/getting-started.html",         "categories": [{               "id": "menucompilingfromsource",               "title": "compiling source",               "resource": "/documentation/data/getting-started/compiling-from-source.html"            },{               "id": "menudownloadreleasepackage",               "title": "download release package",               "resource": "/documentation/data/getting-started/downloading-release-package.html"           },{               "id": "menubuildingyourfirstapplication",               "title": "building first application",               "resource": "/documentation/data/getting-started/building-your-first-application.html"          }]    } ] 

now, can retrieve item out of menu using jquery , result might item:

{     "id": "menubuildingyourfirstapplication",     "title": "building first application",     "resource": "/documentation/data/getting-started/building-your-first-application.html"  } 

now, want retrieve elements @ higher level , items directly below item.

any highly appreciated.

jquery querying html elements within dom of current document, not traversing objects or json expression strings.

in case, given object, there no way "discover" objects, variables, or arrays might hold reference it.

i'd recommend picking decent javascript book , becoming familiar basics. maybe stay away things jquery @ first can confuse things you.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -