I'd like to search only a specific piece of a string and show it using nothing more than JS or Jquery.
For example, (It just looks like a JSON, but it's not, it's just brackets some stuff ;) ):
var data =
[{"name":"node1","id":1,"is_open":true,"children":
[
{"name":"child2","id":3},
{"name":"child1","id":2}
]
}];
I'd like to pick up only the ID numbers:
The "code" below is not a language, it's just an example to help understanding what I'd like to do on JS/jQuery
var IDs = [searchThrough] data [where there is] "id": [getContent] after : and before , or } alert("IDs: "+IDs);
It allows me to:
1 - set a parameter of what I want from a string find "id": on data.
2 - set the start and end for getting the content after : and before , or }
How can I do it?
Thanks in advance.
"Beam me up Scotty!"
idproperties in the array of objects? Even those on thechildren?