Details :
Have a good day programmers. My server is returning me the multidimensional json array.Now i just want to access it individually and also i am little bit confused in JSON format.
Question 1: what is the difference between these Type1 and Type2 json format?
JSON Type 1
{
"name": "Stackoverflow",
"exp": "4month",
"status":
{
"username": "koushik",
"password": "mypassword"
}
}
JSON Type 2
{
"name": "Stackoverflow",
"exp": "4month",
"status": [
{
"username": "koushik",
"password": "mypassword"
}
]
}
I know both are valid json format but where it differ's?
Question 2: Using ajax i can handle single dimention json data
Example: It works
$.ajax({
url:"temp.json",
dataType:"json",
success:function(data){
alert(data.name);
}
});
In the same way how could i handle multidimensional json array.Example i want to get something like this alert(data=>status=>username) . I know it is very easy to do but i am struck here. Thanks in advance.