일부 null 값을 포함하는 JSON 객체 (YQL에서)를 파싱 할 때 다음과 같습니다.JSON null 값을 파싱하여 을 얻으시겠습니까?
{
"color": "red",
"size": null,
"brand": "Nike",
},
{
"color": null,
"size": "XXL",
"brand": "Reebok",
},
{
"color": "blue",
"size": "small",
"brand": null,
},
jQuery를 사용하여 일부 마크 업을 생성합니다.
function (data) {
$("#content").html('<table></table>');
$.each(data.query.results.row, function (i, item) {
$("table")
.append('<tr><td class="color">' + item.color + '</td><td class="size">' + item.size + '</td><td class="brand">' + item.brand + '</td></tr>');
});
null을 공백으로 변경하거나 (적어도 jQuery에서) 적어도 td에 클래스를 넣으시겠습니까? 즉 :
그래서
<td>null</td>
<td> </td>
또는
<td class="hidethis">null</td>
와
item.color
을 대체 내가 좋아하는 경우 - 다른. 감사! – nathanbweb