I have errors in the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1 Id = "Datos"></h1>
<script>
fetch('http://localhost/API_PHP/backend/Datos.php')
.then(Datos => Datos.json())
.then(Datos => {
document.getElementById('Datos').innerHTML = ´
Dolar: ${Datos.Dolar} - Euro: ${Datos.Euro}
´
})
</script>
</body>
</html>
The errors are specifically in this script:
.then(Datos => {
document.getElementById('Datos').innerHTML = ´
Dolar: ${Datos.Dolar} - Euro: ${Datos.Euro}
})
The symbols give me error and the opening keys {
after the $
also and the: after Euro
likewise.
I imagine the syntax is wrong, please thank me for help as I am starting hehehe