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

249
Vistas
function not returning results when called from html file

I am trying to write a script that returns data based on the option (player) selected in the drop down. This post got me 90% of the way there, but I'm tripping over the last piece.

When I select any of my players from the drop down, I expect the sidebar to be populated with that player's stats, but it seems it returns nothing.

I have an onchange event that runs the function selectChange(this), which passes the name of the player I've selected to the function selectChange().

The selectChange() function runs function stats(), which returns the stats of the player for whom the function was passed

I assign what function stats() returns to a variable ("stats") and I overwrite my HTML element with the id "data" with those contents.

I know the stats() function is good - when I run function stats() independently and pass it a player (i.e. stats('David Justice')), I get an expected return. So it's something to do with how I'm calling it in my html file, or how I'm passing the select.value component. I tried String(select.value) but that didn't seem to help. I suspect my error is trivial, but I can't find it!

enter image description here testStats function returns data as expected

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