Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

303
Visualizações
Fetch local data : How to fetch by objects's names

Today, i was doing a really cool project from frontendMentors, a planets website ! We have to do a 8 pages website (each page contains one planet details), we have the choice between writing every planet data directly in the HTML code, or, we can use a local data.JSON to manage it dynamically.

But, I got a problem:

I want to dynamically, with JS and the included data.JSON, write each planet page. So, i was like "Alright, I have to fetch data.JSON, and precise what planet to fetch, like :

fetch(`./data.json/${planetTitle}`)

But it obviously doesn't work like that. So, does anyone knows how to do it ? I'll give further informations like a screen of my JS + a screen of the data.JSON file.

JSON file; script.js;

Thx in advance !

There is the solution !

html trick script trick 1

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda