Can we able to assign the returning data to a variable , which is getting through ajax function?
<p>Following is the function that i am using.</p>

<p>Can we able to assign like this?</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    function validation(){

    var flag

    $.ajax({
      url: 'ajax/test.php',
      success: function(data) {

       flag =data;

      }
    });

    alert(flag);

    }


    &lt;/script&gt;
</code></pre>
