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

153
Views
can i use a javascirpt to reload webpage with two conditions

I want to reload the webpage with confirm form resubmission and only if these two conditions:

  • the web page is completely loaded and the document title still affaching = 504 Gateway Time-out

so I need a script for that: waiting for the page until it is completely loaded, after that the document title still = 504 Gateway Time-out the reload the page with confirm form resubmission

if (document.title == '504 Gateway Time-out' && "document.readyState === "complete"") {setTimeout(function() {window.location.reload(true);},} i have this script but i dont know if it work correctly

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This should get you started.

The following can be used to ensure the page document has fully loaded.

document.addEventListener("DOMContentLoaded", function() { your code here }

docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event

From here you can put your if statement into this function checking the document title and doing what you want to do.

i have this script but i dont know if it work correctly

Have you tested your code to see if it works correctly? Use the console in the developer tool for any javascript errors? Console logging if needed for debugging?

Good luck and hope this helps. If it does please mark that ^ arrow and ✅

about 4 years ago · Juan Pablo Isaza Report
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!