Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The pui.onuseractivity event, if defined, fires every time the user moves the mouse or presses a keyboard key.  It can be used to track user activity and timeouts on the client-side.

Example:

var count = 300;  // 300 seconds or 5 minutes

setInterval(function() {
  count = count - 1;
  if (count < 0) {
    alert("You have been inactive for more than 5 minutes.  Your session will terminate.");
    // to do - quit program or end session here
  }
}, 1000);  // call this every second (1000 milliseconds)

pui.onuseractivity = function() {
  // reset counter
  counter = 300;
}
  • No labels