Auto Refresh SharePoint list using JavaScript and Content Editor WebPart

When we create and add items List will automatically refresh itself.Using "Content Editor" WebPart and
 JavaScript we can do easily.follow steps to do auto refresh SharePoint list in selected page.

  Edit SharePoint Page, Click on 'Insert' tab from ribbon, Select webpart button to insert the WebPart. From Categories list, select "Media and Content" group , Select "Content Editor" web part and click on add button to insert the web part.

Select web part and choose "Edit web part" from the drop down .                                                  

We have to specify the Title to "refresh Page" and Chrome Type to "None" in WebPart edit pane. click on "Ok" .                                                                                                                                                                                        

Now we have to add script to the web page. To do this by clicking the section "click here to add new content" in web part.                                                                                                                             

Cursor will appear in the content area, Don't type anything in the content area, simply go to the ribbon and select "Edit HTML Source" under Format Text.                          

Enter the following JavaScript to add in the HTML Source box.                                                     

<script type="text/javaScript">
function refreshPage() {
    window.location = window.Location;
setTimeout(refreshPage, 300000);

This Script function is calling every 5 minutes will refresh the page. Finally, Save the Page by Click on 'save' in page tab from ribbon.    



Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment


Post a comment