check out what is in actually in theData.  if it's anything like the
page requests i'm making, there's probably a doctype declaration or
other such jazz in there that you're going to need to get rid of with
some string manipulation...

if you design your processEmail.php to return something like:

MyResult:yes

you can use

theData.split("MyResult:")[1];

to get in the neighbourhood of the info you're looking for...

--adam

On Mar 4, 12:43 pm, 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?

Reply via email to