Reputation: 314
I have a very simple ajax call, but i have problems when trying to check 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
}
}
When i try to print request.responseText it prints the expected string, "mystring". But when i try to check it, it doesn't evaluate to true ("other stuff" is executed). Any ideas? Thanks!
Upvotes: 0
Views: 2924