Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!