I'm trying to get the current USD to EUR rate from fixer.io into a single line in a HTML file and replace the "." in the USD value with a ",".
Can somebody help me?
LINK: https://api.fixer.io/latest?symbols=USD
{
"base": "EUR",
"date": "2017-12-04",
"rates": {
"USD": 1.1865
}
}
What i need in a HTML file:
1,1865
EDIT:
This is what i tried so far (literally never done this before):
HTML:
<span id="rate_usd"></span>
JS:
$(document).ready(function(){
var url= "https://api.fixer.io/latest?symbols=USD"
$.getJSON(url,function(data){
document.getElementById("rate_usd").innerHTML = data.rates.USD;
});
});