title: json - what to do when json data returns as [ ] aka empty/null
body: <p>Quick question:</p>
  
  <p>I'm using jquery ajax to call a page that returns some json data. Sometimes it returns full of data and sometimes it returns empty as <code>[]</code>. </p>
  
  <p>I want the script to do different things if it comes back empty<code>[]</code> or with data. Everything is working fine when it returns with data, but I can't seem to get things to work when it returns empty as <code>[]</code>. Here's what i have: </p>
  
  <pre><code>success: function (returndata){
        if (returndata === null)
        {
            $("#versionBox").remove();
        }
   else {
          $.each(returndata, function()
                 {
                     var tag = this["name"];
                     var linkname = "textdisplay.php?flag=&lt;?php echo $fs; ?&gt;&amp;ed=" + tag;
                         $('#versionBox').append("&lt;p&gt;&lt;a href='" + linkname + "'&gt;" +  tag + "&lt;/a&gt;&lt;/p&gt;");
                 });
  
        }
  </code></pre>
  
  <p>But <code>null</code> doesn't seem to be the correct way to describe <code>[]</code> because the first part of this script isn't working.</p>
  
  <p>Thanks for your advice.</p>