Jquery ajax data convert to string

Viewed 31214

I have a problem with my jquery ajax. I have this code:

$.ajax({
    url: '/users/validatepassword/'+current,
    success: function(data){
        status = data;
    },
    async: false
});

if(status == "Password correct")
{
    //do something
}

Basically, I want to capture the "data" that was returned on "success". But I cannot make a way for the if statement to work. I am think the "data" was not a string so I cannot make a comparison.

5 Answers
Related