我有一个json字符串,它正在提供一个javascript页面,我试图通过使用以下代码在屏幕上呈现,但我的条件逻辑不起作用,我想要完成的是如果没有返回数据打印空白区域,否则显示和图标。感谢。
JSON
“时间表”:{ “RCOUNT”:186, “时间表”:[ { “CASEID”:18397020.000000, “SCHEDAREA”: “SURG” “LASTDIETORDERNAME”: “”, “LASTDIETORDERSTARTDT”: “”, }
的Javascript
var dietTable = [];
dietTable.push(
"<table id='dataTable' class='dataTable' cellpadding=0 cellspacing =0>"
,"<tr id='dataTableTH'>"
,"<th class='headers' style='text-align:left;white-space: nowrap;'>Diet</th>"
,"<th class='headers' style='text-align:left;white-space: nowrap;'>Date Time</th>"
,"</tr>"
);
dietTable.push(
"<tr>"
,"<td style='vertical-align:top;text-align:left'>",ptDiet,"</td>"
,"<td style='vertical-align:top;text-align:left'>",ptDietDT,"</td>"
,"</tr>"
);
dietTable.push("</table>");
if(SCHEDULES.LASTDIETORDERSTARTDT !== null) {
dietVal = ['<img border =0 src="..//..//images//dietIcon2.png " width="20px" height="20px" title="'+dietTable.join("")+'">'];
} else {
dietVal = [" "];
}
答案 0 :(得分:0)
这是它,谢谢
if(SCHEDULES.LASTDIETORDERSTARTDT!==&#34;&#34;)