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

503
Views
Javascript method setTimeout() does not work well in Safari browser

I try to develop javascript codes that can give users a warning when the server too long to response the html form submitted. My codes works well in Chrome and Firefox desktop browser, but not in Safari desktop browser.
How to make this works in Safari ? Here are my codes:

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8"/>
   <script type="text/javascript">
      function handleTimeout() {
         document.getElementById("retryButton").disabled = false;
         document.getElementById("message").innerHTML = "Your card's bank 3DS OTP page might be having issue. Please \"Tap to retry\".";
      }
      function retry() {
         setTimeout(handleTimeout, 5000);
         submitForm();
      }
      function submitForm() {
         return new Promise(function(resolve, reject) {
            document.getElementById('requestForm').submit();
            resolve("done");
         });
      }
      function start() {
         document.getElementById("retryButton").disabled = true;
         setTimeout(handleTimeout, 5000);
         submitForm();
      }
      window.addEventListener('load', (event) => {
         start();
      });
   </script>
</head>
<body>
<form id="requestForm" method="post" action="http://localhost:10877/auth/pareq">
   <input type="hidden" name="PaReq" value="eyJ2ZXJzaW9uIjoiMS4wLjIiLC"/>
   <input type="hidden" name="uuid" value="ac456037-995b-4778-bba5-df614db7ebaa"/>
   <input type="hidden" name="Status" value="Y"/>
</form>
<div id="message">Processing OTP</div>
<p>Tap the button below to Retry</p><br/>
<button id="retryButton" onclick="retry();">Tap to retry</button>
</body>
</html>

Function handleTimeout() is not working in Safari but works well in Chrome and Firefox browser.
How to make function handleTimeout() works well in Safari?

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!