Saturday, May 28, 2016

How to Reload SharePoint Page Every 60 Seconds Automatically with JavaScript

Requirement: For a monitoring dashboard, got a requirement to reload Intranet SharePoint site's home page for every five Minutes.

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

  • Navigate to the target page you want to reload. Click on 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 "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).



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...