I Have this piece of code
(function(){
    $.ajax({
        type: "POST",
        url: "g.php",
        data: {g:""+a}
    }).always(function(a,b,c){
        console.log(c.responseText);
        if (c.responseText.length < 45 ) {
            return "error";
        } else return (c.responseText);
    });
}())
If I try to assign it to a variable undefined is returned; however, if I console.log it, the expected value is returned... its very confusing...
How can i extract the response, I read somewhere about callbacks however it didn't help. I tried restructuring the code into many fashions with no result.
-- Why does console.log print the right result vs undefined with any other function?
