Advertisement
Saltor

Untitled

Feb 2nd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // added to bottom of html file
  2. <script>
  3.     var secondsDelay = 5;
  4.  
  5.     setInterval(function() {
  6.         reloadQueueListing();
  7.     }, secondsDelay * 1000);
  8.  
  9.     function reloadQueueListing() {
  10.         var xmlhttp;
  11.         xmlhttp = new XMLHttpRequest();
  12.         xmlhttp.onreadystatechange = function() {
  13.             if(xmlhttp.readyState === 4 && xmlhttp.status === 200) {
  14.                 document.getElementById("sidebar-left").innerHTML = xmlhttp.responseText;
  15.             }
  16.         };
  17.         xmlhttp.open("GET", "/rest.queues/queueListing?courseId=21", true);
  18.         xmlhttp.send();
  19.     }
  20. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement