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

180
Views
Can someone tell me why im unable to load Javascript files into separate html file?

Im currently making an electron application. i have an index.html file where ive loaded in Javascript files within the head tag. I am able to access the JS functions without any issues.

I've now created a separate browser window, and for this I've made another html file. When I attempt to load in another JavaScript file it doesn't allow me to access any of the functions. What's weird is that i can load in the CSS file no problem that works. Why is it so much hassle to load in a JS sheet, I've been trying to figure it out for 2 days now :/

I've also attempted to use module.exports in my sidebar.js file so that I can try and trigger the functions using the renderer.js file and the main.js file but it gives me an error saying "document has not been defined"

Can anyone think of a solution? its probably something simple but I'm honestly losing it here.

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

0

Try putting the script tags at the end, right before the end body tag.

about 4 years ago · Juan Pablo Isaza Report

0

  1. Try adding <script module src="sidebar.js"></script>
  2. Or may be you can check that the file name is proper sidebar.js. Just check it once!
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!