Can someone please show me how I can get my JSON data and use it in javascript?

My data looks like this...

[{
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 501",
    "2": "Parameter 501",
    "setting_value": "true",
    "3": "true"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 502",
    "2": "Parameter 502",
    "setting_value": "true",
    "3": "true"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 503",
    "2": "Parameter 503",
    "setting_value": "false",
    "3": "false"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 504",
    "2": "Parameter 504",
    "setting_value": "6",
    "3": "6"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 505",
    "2": "Parameter 505",
    "setting_value": "16",
    "3": "16"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 506",
    "2": "Parameter 506",
    "setting_value": "17",
    "3": "17"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 507",
    "2": "Parameter 507",
    "setting_value": "3",
    "3": "3"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 508",
    "2": "Parameter 508",
    "setting_value": "19",
    "3": "19"
}, {
    "id": "1",
    "0": "1",
    "filename": "CONFIG 1",
    "1": "CONFIG 1",
    "setting_name": "Parameter 509",
    "2": "Parameter 509",
    "setting_value": "19",
    "3": "19"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 502",
    "2": "Parameter 502",
    "setting_value": "false",
    "3": "false"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 503",
    "2": "Parameter 503",
    "setting_value": "true",
    "3": "true"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 504",
    "2": "Parameter 504",
    "setting_value": "6",
    "3": "6"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 505",
    "2": "Parameter 505",
    "setting_value": "16",
    "3": "16"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 506",
    "2": "Parameter 506",
    "setting_value": "17",
    "3": "17"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 507",
    "2": "Parameter 507",
    "setting_value": "3",
    "3": "3"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 508",
    "2": "Parameter 508",
    "setting_value": "18",
    "3": "18"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 509",
    "2": "Parameter 509",
    "setting_value": "19",
    "3": "19"
}, {
    "id": "2",
    "0": "2",
    "filename": "CONFIG 2",
    "1": "CONFIG 2",
    "setting_name": "Parameter 501",
    "2": "Parameter 501",
    "setting_value": "false",
    "3": "false"
}, false]

Basically I have four fields... id, filename, setting_name and setting_value.

I need to know how I can get this and convert it into a javascript array, so that I may use it withing my logic. N

link|improve this question

77% accept rate
possible duplicate of How to parse JSON data, using javascript – vol7ron Aug 26 '11 at 1:13
@vol7ron Looks like an accidental double-post. This one came first – Phil Aug 26 '11 at 1:15
1  
@Phil: I just like to close them both, for the sheer fact that it's a double and the question is horrible to look at. – vol7ron Aug 26 '11 at 1:17
1  
@Carl Weis, please spend more time on your questions. – zzzzBov Aug 26 '11 at 1:19
1  
I went ahead and at least beautified it – vol7ron Aug 26 '11 at 1:21
show 2 more comments
feedback

1 Answer

up vote 3 down vote accepted
o = JSON.parse('your string here');
console.log(o);

http://jsfiddle.net/Lenuk/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.