Last active
December 7, 2017 00:01
-
-
Save tim-bellette/a0cca21413efa8336797165bc1c88070 to your computer and use it in GitHub Desktop.
Simple script to automatically refresh a SharePoint 2010 calendar's items every 10 seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
setInterval(function() { | |
try { | |
var calendar = SP.UI.ApplicationPages.CalendarInstanceRepository.firstInstance(); // Get the first calendar instance on the page | |
if (calendar) { | |
calendar.refreshItems(); // async refresh of calendar items | |
} | |
} | |
catch (e) { | |
// ignore | |
} | |
}, 10000); // Every 10 seconds | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment