2024-08-01 14:06:16 +01:00
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<p id="price"></p>
|
|
|
|
|
|
|
|
<script>
|
2024-08-13 19:29:56 +01:00
|
|
|
fetch("https://api.baseddata.io/get_json/final__price.json")
|
2024-08-01 14:06:16 +01:00
|
|
|
.then((response) => response.json())
|
|
|
|
.then((data) => {
|
|
|
|
var lastElement = data[data.length - 1];
|
|
|
|
document.getElementById("price").innerHTML =
|
|
|
|
`The current price is: <em>$ ${lastElement.price.toLocaleString()}</em> (${lastElement.date}) `;
|
|
|
|
})
|
|
|
|
.catch((error) => {
|
|
|
|
console.error("Error:", error);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|