I was hoping it would be this easy. But no, alert is never called. Please help.
$.getJSON("http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json&view=basic&callback=?", function(result){
//response data are now in the result variable
alert(result);
});
I tried the accepted answer on Yahoo JSONP Ajax Request Wrapped in callback function but that doesn't work for me either :(
I made a jsfiddle from that but no luck.
var quote;
$(".price").text("please");
$(document).ready(function() {
$.ajax({
url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%3D%22AAPL%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=quote",
dataType: "jsonp",
jsonp: "callback",
jsonpCallback: "quote"
});
quote = function(data) {
$(".price").text("$" + data.query.results.quote.AskRealtime);
};
});