I have a json string which is feeding a javascript page, I am trying to render on the screen, by using the following code, but my conditional logic is not working, what I want to accomplish is if there is not data returned print a blank space, otherwise show and icon. Thanks.
JSON
"SCHEDULES":{ "RCOUNT":186, "SCHEDULE":[ { "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 = [" "];
}