Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

74
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda