title: Ajax response handling and assigning to variable
body: <p>Hello i have some problem with ajax response handling</p>
  
  <p>i have a global function <strong>call</strong>() that makes ajax calls and just returns json response:</p>
  
  <pre><code>function call(request_url,params) {
      $.post(request_url,params,function(response) {
          return response;
      },'json');
  }
  </code></pre>
  
  <p>After that i have an object GetServices that uses global function <strong>call()</strong></p>
  
  <pre><code>    var GetServices = {
        service_url:"http://xxx.com/req.php",
  
        getCurrency:function() {
              var resp = call(this.service_url,{act:'getCurrency'});
              return resp;
        }
      }
  </code></pre>
  
  <p>I want <strong>GetServices.getCurrency()</strong> to return the ajax response but it returns undefined. Javascript assigns value <strong>undefined</strong> to it and after that finishes ajax call. </p>
  
  <p>Please help me how to fix this.</p>