i've got a problem with a $.json jQuery call function, this is my code :
// function to get currency live rates from yahoo api keys
function getRate(from, to) {        
  $.getJSON('http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22'+from+to+'%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=', function(data) {
    var rate  = data.query.results.rate.Rate; 
    return rate; 
  });
}// end of function
var receive = getRate('USD','EUR');
 
     
     
    