How can I haveimprove this window timeout alert code here,? I need to add it to some third-party master page and don't want to add a separate file for it.
It must be JS only and IE-8 supported.
(function () {
// timedRefresh(10); //3600000
delayedAlert();
var timeoutID;
function delayedAlert() {
clearAlert();
timeoutID = window.setTimeout(slowAlert, 10000);
}
function slowAlert() {
alert("You may have been logged out due to inactivity. Click OK to refresh the page.");
}
function clearAlert() {
window.clearTimeout(timeoutID);
}
})();
http://jsfiddle.net/03rLey2L/6/
How can i improve this window timeout alert code as I need to add it to some third party master page and don't want to add a separate file for it.
Must be JS only and IE-8 supported.