<script type="text/javascript">

    var global;

    function ajax_assign(){

        $.ajax(

            url:xxx,

            data:{'xx.xx':xx},

            type:'post',

            dataType:'json',

            async : false,

            success:function(data){

               global = data;

            }

        );

        alert(global);

    }

</script>