Имеется такой файл JSON лежащий на стороннем сайте
{
"USD" : {"15m" : 672, "last" : 672, "buy" : 671.15, "sell" : 672, "symbol" : "$"},
"ISK" : {"15m" : 84125.66, "last" : 84125.66, "buy" : 84019.26, "sell" : 84125.66, "symbol" : "kr"},
"HKD" : {"15m" : 5213.93, "last" : 5213.93, "buy" : 5207.33, "sell" : 5213.93, "symbol" : "$"},
"TWD" : {"15m" : 21843.49, "last" : 21843.49, "buy" : 21815.86, "sell" : 21843.49, "symbol" : "NT$"},
"CHF" : {"15m" : 655.96, "last" : 655.96, "buy" : 655.13, "sell" : 655.96, "symbol" : "CHF"},
"EUR" : {"15m" : 611.12, "last" : 611.12, "buy" : 610.34, "sell" : 611.12, "symbol" : "€"},
"DKK" : {"15m" : 4535.31, "last" : 4535.31, "buy" : 4529.58, "sell" : 4535.31, "symbol" : "kr"},
"CLP" : {"15m" : 454810.27, "last" : 454810.27, "buy" : 454234.99, "sell" : 454810.27, "symbol" : "$"},
"CAD" : {"15m" : 875.3, "last" : 875.3, "buy" : 874.19, "sell" : 875.3, "symbol" : "$"},
"CNY" : {"15m" : 4463.97, "last" : 4463.97, "buy" : 4458.32, "sell" : 4463.97, "symbol" : "¥"},
"THB" : {"15m" : 23743.13, "last" : 23743.13, "buy" : 23713.1, "sell" : 23743.13, "symbol" : "฿"},
"AUD" : {"15m" : 907.19, "last" : 907.19, "buy" : 906.05, "sell" : 907.19, "symbol" : "$"},
"SGD" : {"15m" : 912.77, "last" : 912.77, "buy" : 911.61, "sell" : 912.77, "symbol" : "$"},
"KRW" : {"15m" : 793086.55, "last" : 793086.55, "buy" : 792083.39, "sell" : 793086.55, "symbol" : "₩"},
"JPY" : {"15m" : 68354.97, "last" : 68354.97, "buy" : 68268.51, "sell" : 68354.97, "symbol" : "¥"},
"PLN" : {"15m" : 2722.06, "last" : 2722.06, "buy" : 2718.61, "sell" : 2722.06, "symbol" : "zł"},
"GBP" : {"15m" : 509.69, "last" : 509.69, "buy" : 509.05, "sell" : 509.69, "symbol" : "£"},
"SEK" : {"15m" : 5724.49, "last" : 5724.49, "buy" : 5717.24, "sell" : 5724.49, "symbol" : "kr"},
"NZD" : {"15m" : 951.42, "last" : 951.42, "buy" : 950.22, "sell" : 951.42, "symbol" : "$"},
"BRL" : {"15m" : 2266.07, "last" : 2266.07, "buy" : 2263.21, "sell" : 2266.07, "symbol" : "R$"},
"RUB" : {"15m" : 43829.61, "last" : 43829.61, "buy" : 43774.17, "sell" : 43829.61, "symbol" : "RUB"}
}
Нужно отобразить только "RUB" : "last" : 43829.61
<script>
$.getJSON('https://blockchain.info/ru/ticker', function(data) {
var output = '<ul>';
$.each(data, function(key, val) {
output += '<li>' + val.last + '</li>';
});
output += '</ul>';
$('#btc').append(output);
});
</script>
При таком подключении выводятся значения "last" всех валют, нужен только RUB