Hey all,
Been a while since i posted here so, hai again.
This is weird to me, dont under stand it.
I am new to Java and Ajax but PHP is my best friend.
Basically, i have some Ajax that checks a PHP script and when done, the PHP Script will echo either 0 or 1 (success or fail).
This is the code (not alot to see).
var response = ajaxRequest.responseText;
if(response == "1"){
alert("Success");
}else{
alert("Failed");
}
There is more to the code, but thats simplfied and yeilds the same result.
If i do alert(response); it shows either a 1 or 0.
However when i do the If(response == “1”) etc it always defaults to the else part of the statment even when the response var == 1.
I cannot seem to get any string comparison to work.
I have tried a few things like trimming white space but i’m not getting anywhere.
Thanks for any help.
Steve