Help guys with stupidity in js. JSON in return_arr variable

return_arr = jQuery.parseJSON( ret ); 

I write in the console js return_arr, I get in response:

 Object chart_map: Array[7] current_month: 10 text_month: "Октябре" value: "4geo-Сургут" __proto__: Object 

And I think about a miracle, all that I need to successfully enclosed and placed for me in the object. Next, I write return_arr.chart_map and get:

 return_arr.chart_map undefined 

=> as so, how can I get an array out of an object?

  • one
    Some kind of garbage .. so can not be :) Try to just decode your return_arr with eval. And after an unsuccessful attempt to get chart_map, return_arr is still in place? - cy6erGn0m
  • If you are back then the return_arr is a string! - timka_s

2 answers 2

Try return_arr = array() from the beginning. And then apply as return_arr[chart_map]

    Thank you all for the feedback, zaenkodilos curved like that, changed php and it all worked

    • "something is not working? Change the version of PHP!" :)) - Vasily Barbashev