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.
//on success
success: function(data) {
if(data == 'null') {
buildaccordion("<h3>No Results Found</h3><div>No Data to Show.</div>");
return;
}
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!?
This was working fine before and I can not see what would be causing this.
I have also tried
== null
=== null
=== 'null'