I want to reload the webpage with confirm form resubmission and only if these two conditions:
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
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 ✅