Skip to main content
deleted 13 characters in body; edited tags; edited title
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

window Window timeout alert

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.

jsFiddle

(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.

window timeout alert

I have this code here,

(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.

Window timeout alert

How can I improve this window timeout alert code? 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.

jsFiddle

(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);
    }
})();
added 8 characters in body; edited title
Source Link
Mathematics
  • 934
  • 2
  • 8
  • 27

I want to shorten this code as much as possible - window timeout alert

I have this code here,

(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/

I need to shorten it as much as possibleHow 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.

I want to shorten this code as much as possible - window timeout alert

I have this code here,

(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/

I need to shorten it as much as possible 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.

window timeout alert

I have this code here,

(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.

Source Link
Mathematics
  • 934
  • 2
  • 8
  • 27

I want to shorten this code as much as possible - window timeout alert

I have this code here,

(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/

I need to shorten it as much as possible 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.