multidimension json array

multidimension json array

Hi there, I have a multidimension array:

  1. {
  2.   "errorCode": 200,
  3.   "errorMsg": null,
  4.   "obj": [
  5.     {
  6.       "comparableInfo": null,
  7.       "id": 1,
  8.       "name": {
  9.         "comparableInfo": null,
  10.         "val": "EUROPA",
  11.         "id": 0,
  12.         "description": null,
  13.         "traslation": {
  14.           "EN": {
  15.             "comparableInfo": null,
  16.             "lang": null,
  17.             "val": "EUROPE"
  18.           },
  19.           "IT": {
  20.             "comparableInfo": null,
  21.             "lang": null,
  22.             "val": "EUROPA"
  23.           }
  24.         }
  25.       },
  26.       "img": {
  27.         "comparableInfo": null,
  28.         "id": 0,
  29.         "name": "",
  30.         "url": null,
  31.         "file": null,
  32.         "contentType": null,
  33.         "comments": null,
  34.         "owner": null,
  35.         "likes": null,
  36.         "tags": null,
  37.         "is": null,
  38.         "numberOfLike": 0
  39.       }
  40.     },
  41.     {
  42.       "comparableInfo": null,
  43.       "id": 2,
  44.       "name": {
  45.         "comparableInfo": null,
  46.         "val": "ASIA",
  47.         "id": 0,
  48.         "description": null,
  49.         "traslation": {
  50.           "EN": {
  51.             "comparableInfo": null,
  52.             "lang": null,
  53.             "val": "ASIA"
  54.           },
  55.           "IT": {
  56.             "comparableInfo": null,
  57.             "lang": null,
  58.             "val": "ASIA"
  59.           }
  60.         }
  61.       },
  62.       "img": {
  63.         "comparableInfo": null,
  64.         "id": 0,
  65.         "name": "",
  66.         "url": null,
  67.         "file": null,
  68.         "contentType": null,
  69.         "comments": null,
  70.         "owner": null,
  71.         "likes": null,
  72.         "tags": null,
  73.         "is": null,
  74.         "numberOfLike": 0
  75.       }
  76.     },
  77.     {
  78.       "comparableInfo": null,
  79.       "id": 3,
  80.       "name": {
  81.         "comparableInfo": null,
  82.         "val": "AFRICA",
  83.         "id": 0,
  84.         "description": null,
  85.         "traslation": {
  86.           "EN": {
  87.             "comparableInfo": null,
  88.             "lang": null,
  89.             "val": "AFRICA"
  90.           },
  91.           "IT": {
  92.             "comparableInfo": null,
  93.             "lang": null,
  94.             "val": "AFRICA"
  95.           }
  96.         }
  97.       },
  98.       "img": {
  99.         "comparableInfo": null,
  100.         "id": 0,
  101.         "name": "",
  102.         "url": null,
  103.         "file": null,
  104.         "contentType": null,
  105.         "comments": null,
  106.         "owner": null,
  107.         "likes": null,
  108.         "tags": null,
  109.         "is": null,
  110.         "numberOfLike": 0
  111.       }
  112.     },
  113.     {
  114.       "comparableInfo": null,
  115.       "id": 4,
  116.       "name": {
  117.         "comparableInfo": null,
  118.         "val": "AMERICA",
  119.         "id": 0,
  120.         "description": null,
  121.         "traslation": {
  122.           "EN": {
  123.             "comparableInfo": null,
  124.             "lang": null,
  125.             "val": "AMERICA"
  126.           },
  127.           "IT": {
  128.             "comparableInfo": null,
  129.             "lang": null,
  130.             "val": "AMERICA"
  131.           }
  132.         }
  133.       },
  134.       "img": {
  135.         "comparableInfo": null,
  136.         "id": 0,
  137.         "name": "",
  138.         "url": null,
  139.         "file": null,
  140.         "contentType": null,
  141.         "comments": null,
  142.         "owner": null,
  143.         "likes": null,
  144.         "tags": null,
  145.         "is": null,
  146.         "numberOfLike": 0
  147.       }
  148.     },
  149.     {
  150.       "comparableInfo": null,
  151.       "id": 5,
  152.       "name": {
  153.         "comparableInfo": null,
  154.         "val": "OCEANIA",
  155.         "id": 0,
  156.         "description": null,
  157.         "traslation": {
  158.           "EN": {
  159.             "comparableInfo": null,
  160.             "lang": null,
  161.             "val": "OCEANIA"
  162.           },
  163.           "IT": {
  164.             "comparableInfo": null,
  165.             "lang": null,
  166.             "val": "OCEANIA"
  167.           }
  168.         }
  169.       },
  170.       "img": {
  171.         "comparableInfo": null,
  172.         "id": 0,
  173.         "name": "",
  174.         "url": null,
  175.         "file": null,
  176.         "contentType": null,
  177.         "comments": null,
  178.         "owner": null,
  179.         "likes": null,
  180.         "tags": null,
  181.         "is": null,
  182.         "numberOfLike": 0
  183.       }
  184.     }
  185.   ]
  186. }
I need have this data id, name:value from it 

I try write some code but I can't understand how parse the sub array like name.

this is my primitive code:

  1. $(function(){
  2.           
  3.           var data;
  4.           var l_id_nation;
  5.           var name;
  6.           
  7.           $.ajax({
  8.               
  9.     type: 'GET',
  10.     dataType:'json',
  11.     url:'json.php',
  12.     
  13.     success: function(response) {
  14.        
  15.         data = response.obj;
  16.         
  17.         console.log(data);
  18.         $.each(data, function(i, id_nation){
  19.          
  20.             l_id_nation = id_nation.id;


  21.     $('#sidemenu').append('<li>'+l_id_nation+'</li>');
  22.             
  23.         });
  24.         
  25.     },
  26.     error: function(xhr, ajaxOptions, thrownError) {
  27.       alert(xhr.status);
  28.       alert(thrownError);
  29.     }
  30. });

});

my target is have the id and the name of continet for it

so I can write 

  1. $('#sidemenu').append('<li><a href=url/'+id+'>'+name+'</a></li>');