Somehow I have confused myself.
Somehow I got it in my head that when hitting PHP with AJAX (like $.post), you had to echo back a "true" or "false" instead of returning true/false. I see now that is not the case, but can someone break it down for me?
Is it that there is a problem testing a boolean? Like here
...
$.post('ajax/doThing',{data: data},
function(response) {
if(response) {
doThis();
}else{
doThat();
}
That is the problem case, correct? Here I cannot return true/false, instead I must echo back a string and test the string, yes?
if(response === "true")
But I have seen boolean true/falses returned to ajax functions. What is the use of this, if you cannot test a boolean on the AJAX side? And why can't ajax test a boolean?
Or am I still confused?
EDIT
Just wanted to thank everyone for their good answers on this. I am now +2 smrter.