Hello.
https://api.upbit.com/v1/ticker?markets=KRW-XRP
How can I code the ripple price in HTML in Upbit api?
I got the source through Google search, but I applied ComchoBora, but it doesn't work. Please help me. h
// upbit function
function upbit(){
$.get('https://api.upbit.com/v1/ticker?markets=KRW-XRP', function(data) {
var upbit_xrp = parseFloat(data['trade_price']);
$('#upbit_XRP').html('\\ ' + numberWithCommas(upbit_xrp));
});
}
Import
</script>
</head>
<body onLoad="proc()">
<p>Upbit XRP: <spanid="upbit_XRP"></span> </p>
</body>
The structure of the given json
is object arraytrade_price key of an object, which is the first element of the array, is viewed as float
and read it and inserted into upbit_xrp
...
var upbit_xrp = parseFloat(data[0].trade_price);
The rest of it doesn't work... I can't give you an answer because there's not enough sauce.
© 2024 OneMinuteCode. All rights reserved.