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

174
Views
Load next page without waiting for button click

I have a results page with a button that once pressed redirects to a destination page. On the results page I also have a function that clicks 5 hidden HTMX buttons which activate a Django function that loads flight prices.

I find that the when I click the redirect button, instead of automatically loading the destination page, it waits for the 5 hidden flight prices buttons to be clicked first. This is causing the destination page to load very slowly. I tested this by removing the function that clicks the 5 hidden buttons and noticed that the destination page loaded very quickly. How can I have the destination page load without waiting for the 5 hidden buttons on the results page to be clicked?

javascript

<!-- get flight prices script -->
<script type="text/javascript">
    async function auto_button_click() {
        // if mobile            
        if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
            // click htmx button
            document.getElementById("price_button7").click();
            document.getElementById("price_button8").click();
            document.getElementById("price_button9").click();
            document.getElementById("price_button10").click();
            document.getElementById("price_button11").click();
            document.getElementById("price_button12").click();
        }
        // if desktop
        else {
            // click htmx button
            document.getElementById("price_button1").click();
            document.getElementById("price_button2").click();
            document.getElementById("price_button3").click();
            document.getElementById("price_button4").click();
            document.getElementById("price_button5").click();
            document.getElementById("price_button6").click();
        }
    }
</script>
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!