How can I return value from $.getJSON function?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6911867/how-to-return-value-from-getjson">How to return value from $.getJSON</a>  </p>
</blockquote>



<pre><code>        function get_url(){
            var returnValue  = null;
            $.getJSON('http://127.0.0.1:1337/?callback=?&amp;command=get_url', "", function(data){
                data = $.parseJSON(data);
                returnValue = data[0].get_url;
                console.log(returnValue); // "not_null"

            }); 
            console.log(returnValue);  // "null"
            return returnValue;
        }
</code></pre>

<p>Why function don't return "not_null" ?</p>
