I'm encountering a problem with a simple ajax call that involves checking the returned text against a string:
// in my php file
echo 'mystring';
// in my javascript
if((request.readyState == 4) && (request.status == 200)){
if(request.responseText == "mystring"){
// stuff
}else{
//other stuff
}
}
Although when I print request.responseText, it displays the expected string "mystring", for some reason, it doesn't evaluate to true when checked ("other stuff" is executed). Any suggestions or thoughts on why this might be happening? Thank you!