欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

判斷Session的過期時(shí)間 采用JavaScript實(shí)時(shí)顯示剩余多少秒

 更新時(shí)間:2008年12月29日 16:59:15   作者:  
判斷Session的過期時(shí)間-采用JavaScript顯示剩余多少秒
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%session.timeout=1440 '單位(分鐘)1440=24小時(shí) 參數(shù)不能大于24小時(shí) 也就是不能大于1440分鐘%>
<%
if session("login")<>"888888" then'判斷Session是否有效
Response.Write("Session過期了")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標(biāo)題文檔</title>
<script>
var lefttime=6 //session時(shí)間傳遞
var tid
function x()
{
lefttime--
document.all.xx.innerText="剩余:"+lefttime + "秒"
if(lefttime==0) {clearInterval(tid);document.all.xx.innerText="登錄超時(shí)了" }
}
tid = window.setInterval("x()",1000)
</script>
</head>
<body>
<div id=xx></div>
http://www.dbjr.com.cn
</body>
</html>
能不能在時(shí)間到的時(shí)候彈出一個(gè)警告,點(diǎn)擊之后進(jìn)入另一畫面?
<script>
var lefttime=3 //session時(shí)間傳遞
var tid
function x()
{
lefttime--
document.all.xx.innerText="剩余:"+lefttime + "秒"
if(lefttime==0)
{
window.clearInterval(tid);
if(window.confirm("您要進(jìn)入嗎?"))
window.open("http://www.dbjr.com.cn/")
}
}
tid = window.setInterval("x()",1000)
</script>
<body>
<div id=xx></div>
不要window.open打開另一個(gè)頁面,要在原來的那個(gè)頁面上打開新的頁面。
將window.open("http://www.dbjr.com.cn/")改成
window.locaton.href="http://www.dbjr.com.cn"就行了

相關(guān)文章

最新評(píng)論