0
我想在menuData.json中顯示Products.MenuName但它不起作用。我怎樣才能致電產品數據?這裏是我的json數據和函數。我想在menuData.json中顯示Products.MenuName
"d": {
"PageCount": 4,
"RowCount": 12,
"ResultSet": [
{
"Menu": "Hamburger Menu",
"Price": -1,
"Products": [
{
"MenuName": "Chips ",
"ExtendedPrice": "7,00",
}
]
}
}
$.getJSON('menuData.json', function(read_data){
$.each(read_data.d.ResultSet.Products,function(i,food){
$("#hims").append("Menus: "+food.MenuName);
});
});
<button id="getdata-button">Click Me</button>
<div id="hims"></div>