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

76
Visualizações
Why doesn't my event handler work in Javascript?

I made a game with Unity and now I want to make a game launcher for it. I already start and I have a problem now. I use electron with Html, Css and want to use JS in the backend. I have an button with an ID and in JS I have an event handler for it.

Thats the inportant part of Html:

<img id="startGame" class="instances-icon1" src="assets/icons8-add-48.png">

And thats the important part of Javascript:

const updateURL = 'https://www.dropbox.com/sh/smphut3qh3z40p6/AACHccLIURSjFd3a1vHrMmq4a?dl=1';
const executablePath = 'C:\Users\Linus\Documents\Bluci Runners\exe';

document.getElementById("startGame").addEventListener("click", function() {
  fetch(updateURL).then(res => res.blob()).then(blob => fs.createWriteStream(executablePath).write(blob));
  console.log("Succes!");
})

The dropbox link is where Js shall download the game. My problem is that the event handler isnt working.

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