Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!