calling jquery ajax function from javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4982983/jquery-ajax-return-value">jQuery ajax return value</a><br>
  <a href="http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call-from-a-function">How to return the response from an AJAX call from a function?</a>  </p>
</blockquote>



<p>I have javascript. It loads data from database. I want to return true or false with respect to loading data. But I could not return it. My code has given bellow:</p>

<pre><code>function CheckISRC() {
     var url = "/TrackEdit/CheckISRC/" + $('#isrcid').val();
     var isrc = $('#isrcid').val();
     var result = false;
     $.get(url, {
         isrc: isrc
     }, function (data) {
         if (data == "true") {
             result = true;
         }
         else {
             result = false;
         }
     });
     return result;
 }
</code></pre>

<p>It always gives false result. Anyone has faced this kind of problem? 'Thanks advance'</p>
