function test(){
    var distance=null;
           first();      
    alert(distance);//it shows null always because it take 2 second to complete.
    }
     function first(){
 $.post("v.....fi.aspx", { "func": "xxxxx", xxxxx: xxxx},                                                                        function (data) {     
 distance=dis;  // update the value of distance but it takes 2 second to complete.
});  
    }
But the alert does not shows the distance value.please help me
 
    