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

304
Vistas
How do I get a random image from a folder? (javascript)

Currently, I do it like this, but I would like to be redirected to a random image in the folder ./images/ which all look something like "646673.png". at the end, you should be brought randomly to a page that looks similar to this one: "https://image.com/images/646673.png"

    const images = [
        "http://www.google.com",
        "http://www.stackoverflow.com",
        "http://www.example.com",
        "http://www.youtube.com"
    ]


    var i = Math.floor(Math.random()*images.length);
    window.location.href = images[i]

As more and more images are added, it would be easier this way, so I don't have to enter each image as a link separately, I hope this is possible somehow

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