There is a json string

var str='{"name1":"1","name2":"2","name3":["1","2","3"]}'; data = $.parseJSON(str); alert(data.name3.....?); //?? 

How to get access to the internal non-associative array?

    1 answer 1

    data.name3 is an array here, and so on. weird question.

     var str='{"name1":"1","name2":"2","name3":["1","2","3"]}'; var data = $.parseJSON(str); alert(data.name3[0]); //!!! 1 

    http://jsfiddle.net/oceog/ZAayj/

    • That's it, that the array, but I get an error gives the following name3 is not defiend - Yoharny Babay
    • and where it gives (in the example, everything works), it is obvious that your str is not what you are showing. do console.log (data) and expand the object in the debugger. - zb '
    • I have data like this: Object name1: "1" name2: "2" name3: Array [3] 0: "1" 1: "2" 2: "3" length: 3 - zb '10
    • I have the same, but swears when referring to the array - Yoharny Babai
    • in fiddle too? which browser? - zb '