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

128
Views
Path problem while Including a js file in several html files which are located in different folders

enter image description here

There are several html files(index.html, somewhere1.html, somewhere2.html...), and they all include same js file(script.js). And the js file(script.js) fetches a json file(data.json). The problem is, when script.js tries to fetch data.json, I cannot use same relative path(./data.json). I know I can use absolute path, but I cannot confirm where the whole folder would be located so absolute path can be changed depending on the situations.

How can I solve this problem?

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!