try converting it to a string value theData.toString();
probably wont work though - maybe better to have the PHP script return a boolean true or false or 1 and 0 and then making sure your response type is value. On Mar 4, 9:43 am, rpupkin77 <[EMAIL PROTECTED]> wrote: > Hi, I have a simple ajax app that returns a dataType of "text" with a > string of either "yes" or "no". > > The script works fine, but for some reason, when I try to use an if/ > else statement to evealutae the response, it always return false. > > in the following example, my code will alert "yes" but the if > statement acts as if the data variable is not equal to it, even when > it is > > For example: > var d = page.php?params; > > $.ajax({ > type: "GET", > url: "/ajax/processEmail.php", > data: d, > dataType: "text", > success: function(theData, msg){ > > alert(theData); > > if(theData=="yes") > { > do this;} > > else > { > do this; > > } > }); > > any ideas?