First, make sure that you are working with valid JSON. Go to an online JSON validator like JSONlint and confirm that the code is actually valid. Here is an example of a valid JSON object:
Now, are you looking to get the objects that have a particular key in the JSON? Are you looking for an array of objects that match on a particular value? Perhaps you want both, grabbing the object that matches a key and value. The getObjects function below will allow you to retrieve all these things from your JSON string.
I have also included a getValues function that will return an array of values that match on a certain key. Finally, the getKeys function will return an array of keys that match on a certain value. Here is the code:
Tempo – a tiny JSON rendering engine that enables you to craft data templates in pure HTML
Convert XML to json
CSS-like selectors for JSON
JSONMate – JSON editor, inspector and beautifier