Jump to content


Photo

Using returnValues with an array problems


  • Please log in to reply
1 reply to this topic

#1 phpjayx

phpjayx

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts

Posted 02 February 2013 - 11:27 PM

The below function is when I have my users log on.

I've been working on this for hours, still unable to figure it out.... When I login with a valid user ID, it correctly logs in... My problem is getting the Alerts to work. When my data did not have mulitple return values it worked... but now that I added the additional parameter from the PHP file, the alerts do no work anymore.... I've attempted to use a $.parseJSON statement on the returnValue, but that doesn't work.....I don't know how to get at the "false" or "-1" output Any suggestions???? Please :)


-------------------------------------------------the return statement from my PHP file

return $json.'^'.$json1;

-------------------my debugger output when entering an invalid password
^false

--------------------------------------------------------- My .js file
function onSuccessLogin(data)
{


var temp = data.split("^");
var returnValue = temp[1];
var returnValue2 = temp[2];

parseDataJson(returnValue2);


if (returnValue == 'false')
alert('Login fail');
else
{
if (returnValue == '-1')
{

alert('You need to click on your email confirmation first');
}
else
{..........................

#2 phpjayx

phpjayx

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts

Posted 02 February 2013 - 11:40 PM

Ignore... I figured it out.....

Almost the same code.... I didn't realize it was stopping on the error within the function parseDataJson(returnValue2);

So I just had to move that line down in the else statement...........




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com