Ajax success value to parent function

Ajax success value to parent function

Hello,

At the moment i got the following:
  1. var $test = false;
                $.ajax({
                    type    : "POST",
                    dataType: "json",
                    url     : "ajax.login.php",
                    data    : {
                                    action        : "status"
                    },
                    success    : function(data)
                    {
                        alert(data.status);
                        if(data.status == 0)
                        {
                            $test = true;   
                        }
                        else if(data.status == 1)
                        {
                            $test = false;
                        }
                    },
                    error    : settings.ajaxError
                });   
                return $test;





















What i want is the value of the ajax postback in $test. But this does not seem to work.

Any sugestions?

Cheers,

Niels