Click to See Complete Forum and Search --> : Frames on timeout redirect to login in screen
anifled
12-04-2003, 09:36 PM
I have three frames displayed in a page. When timeout occurs I want to be reirected to the application login in page. Now when timeout occurs the application login page gets displayed within the frame where time out occurred. I want to bypass this and have the application login displayed across the whole page. Also I would like the back button disabled once timeout occurs. I am able to to that with location.replace if there are no frames on a page.
I am new to this. Any help would be appreciated.
requestcode
12-05-2003, 07:13 AM
Can you show us your code? It would help to see it.
anifled
12-05-2003, 01:07 PM
Here is the code
function Minutes(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(0, i));
}
function Seconds(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(i + 1, data.length));
}
function Display(min, sec) {
var disp;
if (min <= 9) disp = " 0";
else disp = " ";
disp += min + ":";
if (sec <= 9) disp += "0" + sec;
else disp += sec;
return (disp);
}
function Down() {
sec--;
if (sec == -1) { sec = 59; min--; }
document.DOHCTYPE.clock.value = Display(min, sec);
window.status = "Session will time out in: " + Display(min, sec);
if (min == 0 && sec == 0) {
alert("Your session has timed out.");
location.replace("DOHCLoginPage.htm") ;
//window.location.href = "back.html";
}
else down = setTimeout("Down()", 1000);
}
function timeIt() {
min = 1 * Minutes(document.DOHCTYPE.clock.value);
sec = 0 + Seconds(document.DOHCTYPE.clock.value);
Down();
}
In the body of the html I do this
<body onload="timeIt();" >
<form name="DOHCTYPE" >
<input type = "hidden" name="clock" size="7" value="00:60" />
requestcode
12-05-2003, 01:39 PM
Try changing this line of code:
location.replace("DOHCLoginPage.htm") ;
To this:
parent.location.replace("DOHCLoginPage.htm") ;
Or:
top.location.replace("DOHCLoginPage.htm") ;
anifled
12-05-2003, 03:35 PM
It worked. Thanks.