does this javascript fire when no result is returned from the database
<p>I have the below code:</p>

<pre><code> $.post('get_as_12', {data:selectedObj.value},function(result) {
 alert(result[0]) ;

      if(result[0] &gt; 0) {
          $('#h12_1').attr('checked','checked');
          alert('12-1');
       } else {
          $('#h12_1').removeAttr('checked');
          alert('12-2');
      }
 }); 
</code></pre>

<p>get_as_12 is a MySQL query.</p>

<p>the alert <code>alert(result[0]) ;</code> is fired correctly when there is a database result. if there however is no result and the returned value is <code>NULL</code> how do I get the alert to still fire. more than this, how do I get the else statement to fire:
<code>$('#h12_1').removeAttr('checked');</code></p>

<p>Thanks in advance.</p>

<p><strong>UPDATE</strong></p>

<pre><code> $.post('get_as_12', {data:selectedObj.value},function(result) {
 alert(result[0]) ;

      if(result[0].length &gt; 0) {
          $('#h12_1').attr('checked','checked');
       } else {
          $('#h12_1').removeAttr('checked');
      }
 }); 
</code></pre>
