<script>  
   var value1;
        $.get("test.php", function(data){
          var mydata= $.parseJSON(data);
          value1 = mydata.value1; 
    });
       console.log(value1);
</script>
in my program the value1 is giving the value in $.get function but when i try to access it outside the get function scope it says undefined
 
    