Hi chaps, I wonder if you can help me with this.
I have the following script:
$(document).ready(function(){
init_get_data();
});
var cars_data;
function init_get_data(){
my_data={"data1":{"-xmlns:fo":"http://www.w3.org/1999/XSL/Format","-xmlns:inlineData":"Lookup","TheAttributes":{"-price":"Price","-other_attribute":"other_value"...
console.log(my_data.data1.TheAttributes.price);
}
Being very new to json I am trying to write on the firebug console to check how to get the values out of the json code. Unfortunately with the above the console returns undefined, and I was wondering why (after I manage to access one value I will try to loop through the json in order to get out more data). I also tried this console.log(my_data.data1.TheAttributes.price);
but the console doesn't like it at all, it returns an error. I wonder if those hyphens before the data are a problem or not
thanks