How to refresh or reload a page with timeout in javascript or jquery
问题 How can I refresh or reload a page with timeout in javascript or jquery only when a specific class is visible or img is not found i found this https://stackoverflow.com/a/14787543/7051635 but there is no timeout and when i'm in front of an omg not found, nothing happened. 回答1: Use the setTimeout() global method to create a timer. This will reload the page after 5000 milliseconds (5 seconds): setTimeout(function(){ location.reload(); }, 5000); This code can be added to any event you need it to