最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

判斷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.fzitv.net
</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.fzitv.net/")
}
}
tid = window.setInterval("x()",1000)
</script>
<body>
<div id=xx></div>
不要window.open打開另一個(gè)頁面,要在原來的那個(gè)頁面上打開新的頁面。
將window.open("http://www.fzitv.net/")改成
window.locaton.href="http://www.fzitv.net"就行了

相關(guān)文章

最新評論

建宁县| 苍溪县| 偏关县| 安多县| 浦县| 尖扎县| 阿坝| 迁安市| 惠水县| 永川市| 永兴县| 青海省| 七台河市| 大连市| 襄樊市| 龙陵县| 崇文区| 灵台县| 宣城市| 信阳市| 锦屏县| 高雄市| 鹤峰县| 凯里市| 两当县| 嵊州市| 德兴市| 阆中市| 万安县| 江都市| 河津市| 昌都县| 成武县| 韶关市| 齐齐哈尔市| 永昌县| 水富县| 大埔县| 长葛市| 义乌市| 兰考县|