0

when we access a page if it is idle for sometime automatically it should redirect the page automatically .if in btwn mouse on click i done then reset the time again .

here is my code

<html>
    <head>
        <title>Session Timeout Warning</title>
        <script>
        function settime()
        { alert("hi");
              setTimeout( 'ShowTimeoutWarning();', 120000 );
        }
            function ShowTimeoutWarning ()
            {
                window.alert( "You will be automatically logged out in five minutes unless you do something!" );
                window.location.href = "demo.html";
            }

        </script>
    </head>
    <body onLoad="settime();" onClick="settime();">

    </body>
</html>

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by MartinRinehart
0

You forgot to ask your question. Your code looks OK so far.

While you think about the question, take the <script> out of the <head> and put it at the end of the <body>. (See Souders High Performance Web Sites.)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.