1 回答

TA貢獻1842條經驗 獲得超13個贊
我試圖重現您的代碼,將 AJAX 調用更改為此
刪除var a=JSON.parse(_items);因為 _items 已經是 JSON 對象
在方法中更改訪問(鍵,記錄)的each 方式。
請注意,您的 財產Settings不在.TaskSettingRecord
$.ajax({
type: 'POST',
url: '@Url.Action("GetMachineSettings")', // we are calling json method
dataType: 'json',
data: {
_items: $("#machines").val()
},
success: function (_items) {
//var a = JSON.parse(_items);
$.each(_items.Settings, function (key, record) {
console.log(key + " " + record);
});
},
error: function (ex) {
alert('Failed to retrieve Tasks.' + ex);
}
});
- 1 回答
- 0 關注
- 93 瀏覽
添加回答
舉報