views:

89

answers:

1

My JSON Data

{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

jQuery code:

$(document).ready(function() {
            $("#Button1").click(function() {    
                var asd = "test";    
                $.get("CallBack.Aspx", { asd: asd }, function(data) {    
                    $.each(data, function() {    
                    })
                })
            })
        })

I need menuitem in values how to make ?

"menuitem": [
      { "value": "New", "onclick": "CreateNewDoc()" } ]
+1  A: 

$.getJSON() fits probably better.

After that,

$.each(data.menu.popup.menuitem, function(i, v) {
    //Your code here
});

Kind Regards

--Andy

jAndy
@jAndy Thank you... i can make
Oraclee