單內容,您好我檢索數據作爲JSON字符串像JSON-如何從一個JSON字符串
var jsonPretty = JSON.stringify(data, null, 2);
{
"GetPageInfoResult": [{
"main": {
"sub": [],
"tittle": "hllo",
"startvalue": "21",
"stopvalue": "45",
"status": "",
"accumalated": "",
"comment": ""
}
}]
}
我要怎樣才能讓我的專欄,內容爲:
$("tr[data-id=1] > td:nth-child(1)").text(hllo)
。
$("tr[data-id=1] > td:nth-child(2)").text(21)
$("tr[data-id=1] > td:nth-child(3)").text(45)
'data [0] .main [「start value」]'會取你'21' – Satpal
檢查這個[demo](https://jsfiddle.net/xLofv5oL/1) – guradio
這可能會幫助你 http: //stackoverflow.com/questions/20813223/jquery-how-to-get-a-row-of-json-data-from-the-json-data-list-by-id-etc –