我正在尝试获取JSON数据并将其添加到行中,但我如何检查数据是否为空?
这就是我想要的,
$.getJSON(url, {
startDate: today.getDate(),
itemCount: 6,
urlparameter: "http://....
})
.done(function (data) {
$.each(data.GetwebMethodResult, function (index, item) {
$("#TableABC").append(FunABC(item.aID, item.b, item.c, item.d, item.e, item.f));
});
function FunABC(a, b, c, d, e, f) {
var row =
"<tr class='Row' onclick=\"AnotherUnrelatedFunction('" + a + "' , '" + b + "', '" + c + "', '" + d + "', '" + e + "', '" + f + "')\">" +
" <div class='mr'>" +
" <td class='mc mci'>" +
" <div class='mcit'>" + a + "</div>" +
" </td>" +
" </div>" +
"</tr>";
return row;
}