Quantcast
Channel: JShidell's SharePoint Blog » CEWP
Viewing all articles
Browse latest Browse all 4

Auto Refreshing SharePoint Page

$
0
0

I’ve been asked many times by my clients if its possible to refresh a SharePoint site on a time interval.  Yes it can, and its fairly simply just by using a Content Editor Webpart and some javascript.  Follow the steps below to auto refresh your SharePoint page/site.

1.  Edit your SharePoint site and add a Content Editor Webpart on your page.
2.  Edit the Content Editor Web Part and inside the Source Editor, copy the javascript code below.

<script>
var reloadTimer = null;
var sURL = unescape(window.location.pathname);
function setReloadTime(secs)
{if (arguments.length == 1)
   { if (reloadTimer) clearTimeout(reloadTimer);
       reloadTimer = setTimeout(“setReloadTime()”, Math.ceil(parseFloat(secs)*1000));
   }  
else   { reloadTimer = null;
     window.location=window.location;
     window.location.replace( sURL );
   }
}
setReloadTime(300);

</script>

3.  Set the setReloadTime(x) to x amount of seconds you would like to wait before refresh.

Enjoy!



Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images