I've just started to learn how to use JSON and this is probably a noob question: ¿why do I have to parse JSON?
I've a JSON object that comes from a php array (I've used it json_encode) and it looks like this:
var jason =
{
"book1": {
"price": 10,
"weight": 30
},
"book2": {
"price": 40,
"weight": 60
}
};
and I can loop through it using the $.each() function, so why would I parse it? After apllying a parse, I cant use $.each() anymore, dunno why. And I dont understand why I cant use something like this: console(jason.book1[1]);
I know that the description in jquery says:
Description: Takes a well-formed JSON string and returns the resulting JavaScript object.
But I dont really get it. Anyway, any help would be appriciated!