Hi Everyone,
I'm fairly new to javascript but I think what I'm trying to do should be quite simple. I've been banging my head on this for the couple of hours though I'm really not sure why its not working.
I'm trying to do a simple string comparison on an ajax plain text response but for some reason I cannot get the string comparison to be true.
I have a XMLHttpRequest object that retrieves a plain text file. In this case the file contains 1 line with the number 100 in it. There are no extra characters in it.
When I retrieve the responseText and display it in an alert box it indeed says its 100.
But for some reason I cannot get the following code to work.
if (xhrRec.responseText == "100") {
alert(SUCCESS!);
}
Can anyone please suggest why this doesn't evaluate to be true when xhrRec.responseText appears to be 100. Any help is greatly appreciated.
Thanks.
Bug.



Reply With Quote


Bookmarks