title: javascript 'if' not catching null from ajax
body: <p>I have a javascript ajax request that return's null if nothing is found and then displays that no results were found to the user. This was working fine before but for some reason has stopped. The IF statement no longer seems to catch the null.</p>
  
  <pre><code>//on success
          success: function(data) {
  
              if(data == 'null') {
                  buildaccordion("&lt;h3&gt;No Results Found&lt;/h3&gt;&lt;div&gt;No Data to Show.&lt;/div&gt;");
                  return;
              }
  </code></pre>
  
  <p>When I look at the response from the php side of things, I am indeed being send the text 'null' from the server. I've also checked with the built in debugger in firefox and the value of data is "null". But the if statement does not catch it!?</p>
  
  <p>This was working fine before and I can not see what would be causing this.</p>
  
  <p>I have also tried</p>
  
  <p>== null</p>
  
  <p>=== null</p>
  
  <p>=== 'null'</p>