title: Getting trouble with JS variables
body: <p>I've following code:</p>
  
  <pre><code>$("#get_details").click(function(){ 
    name = $("#user_name").val();
    var age,gender;
    $.post("users.php", { name: name },
      function(data){
        if (data.status == 'success'){
          age = data.message[0];
          gender = data.message[1];
          alert(age); //getting output
        }
      }, "json");
  
     alert(age);//doesn't getting output
   });
  </code></pre>
  
  <p>I want to access these values outside of <code>$.post()</code>,for this what I've to modify ?</p>