How to Reload SharePoint Page Every 60 Seconds Automatically with JavaScript?

Requirement: I was required to reload the Intranet SharePoint site’s home page for a monitoring dashboard every five minutes.

Solution:

Use this JavaScript placed in a Script editor or content editor web part to refresh a SharePoint page every 60 seconds. Here is how to refresh the current page in SharePoint, step by step:

  • Navigate to the target page you want to reload. Click on the Settings gear and then click on “Edit Page”.
  • Under Insert Tab of the Ribbon, click on “Web Part” and insert “Script Editor” web part from the “Media and Content” group.
    sharepoint web part reload page
  • Edit the script editor web part >> Edit snippet and place the below code in it
<script type="text/javascript">

function refreshPage(){
location.reload(); 
}
setTimeout(refreshPage, 60000);
 
</script>
  • Save and close the page.

This refreshes a SharePoint page for every 60 seconds (or whatever you specify).

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

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