title: How to show message when Ajax function returns 0 record
body: <p>Trying to show a message "No data to display" (while using a <code>DataTable</code>) when <code>JSON</code> returns 0 in a <code>Ajax</code> call. But can't figure it out how. </p>
  
  <p>Tried </p>
  
  <pre><code>$("#noData").show();  
  </code></pre>
  
  <p>with a <em>if</em> statement but didn't work. </p>
  
  <pre><code>&lt;div id="noData" class="grid_4 alpha" style="display: none;"&gt;No data to display&lt;/div&gt;
  </code></pre>
  
  <p>Here is the code that plots the table. </p>
  
  <pre><code>function FillTable() {
      var title = plotData.title + ' / ' + YMLabel(plotData.startYM) + " - " + YMLabel(plotData.endYM);
  
      if (table != null) {
          table.fnDestroy(true);
      }
  
      $("#tabContainer").empty()
          .html('&lt;h1 class="pageTitle"&gt;' + title + '&lt;/h1&gt;&lt;img src="../styles/loading.gif"&gt;');
  
      $.ajax({
          url: "ajax_incidents_table.asp",
          type: "POST",
          data: {
              startYM: plotData.startYM,
              endYM: plotData.endYM
          },
          timeout: 10000,
          success: function (ajaxData) {
              var htmlstr = '&lt;h1 class="pageTitle"&gt;' + title + '&lt;/h1&gt;&lt;table id="table"&gt;&lt;/table&gt;';
              $('#tabContainer').html(htmlstr);
              var tabSettings = {
                  sDom: 'rt',
                  bPaginate: false,
                  sScrollX: "100%",
                  bScrollCollapse: true,
                  bFilter: false,
                  aoColumns: ajaxData.aoColumns,
                  aaData: ajaxData.aaData
              }
              table = $('#table').dataTable(tabSettings);
              SetTooltips()
              ShowDescription();
          },
          error: function (x, t, m) {
              alert('error: ' + m);
              $('#tabContainter').html("&lt;h3&gt;An error has occured. (" + t + " / " + m + ")&lt;/h3&gt;");
          }
      });
  </code></pre>