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

177
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório

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 Relatório
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