JavaScript code to close the current page and reload the parent page after a time delay.

// Set the time delay in milliseconds (e.g., 3000 milliseconds = 3 seconds)
const timeDelay = 3000;

// Close the current page after the time delay
setTimeout(() => window.close(), timeDelay);// Close current page
setTimeout(() => window.opener.location.reload(), timeDelay);// Reload the parent page

Leave a comment

Your email address will not be published. Required fields are marked *