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

190
Views
How to use same JS files for HTML pages?

At the moment, the files setup looks like this: File Setup in the merkur.html file I use this to go to the JS files:

<script src="../scripts/ui.js"></script>
<script src="../scripts/index.js"></script>

The JS is only working on the index.html, in the merkur.html I get the error: Error Message

Can somebody help me?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

In your index.html file, keep the links to your JavaScript files as bellow.

<script src="scripts/ui.js"></script>
<script src="scripts/index.js"></script>

In your merkur.html file, keep the links to your JavaScript files as bellow.

<script src="../scripts/ui.js"></script>
<script src="../scripts/index.js"></script>

If you are still getting errors, you may have do something wrong in your JavaScript codes. Maybe you are trying to search for an HTML element which doesn't exist in your relevant HTML code.

Thanks and best regards!

about 4 years ago · Juan Pablo Isaza Report

0

You can use js files in any html document. The only one problem here is a path you wrote for merkur.html file.

So just read how to deal with path to files. Especially ../ & ./

about 4 years ago · Juan Pablo Isaza Report
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!