Why mark a question as duplicate? Is it for points or to be a wiseass? You can't assume a question won't help someone. The answers from the "duplicated" question didn't answer my question, but the person who answered MY question did. -EDIT
I'm trying to extract just one value from JSON data - the 24 hr price percentage change:
{
"id": "stellar",
"name": "Stellar",
"symbol": "XLM",
"rank": "6",
"price_usd": "0.570132",
"price_btc": "0.00005009",
"24h_volume_usd": "672209000.0",
"market_cap_usd": "10187093680.0",
"available_supply": "17867956333.0",
"total_supply": "103629819514",
"max_supply": null,
"percent_change_1h": "1.8",
"percent_change_24h": "16.65",
"percent_change_7d": "23.95",
"last_updated": "1516839244"
}
Currently, my code only displays [object Object]
:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$.getJSON('https://api.coinmarketcap.com/v1/ticker/stellar/',
function (data) {
document.body.append(data);
});
});
</script>
I want to isolate and display only the "percent_change_24h"
value for now.
Thank you.