您的位置:首页 > 运维架构 > Linux

减少Linux服务器过多的TIME_WAIT

2011-05-26 14:10 363 查看
Javascript5秒之后跳转到指定页面
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Count</title>
</head>
<body>

<div style="text-align: center " >Enter baidu in
<span id="totalSecond" style="text-align: center ;font-family: GulimChe;font-size: 100px;">5
</span>seconds </div>

<script language="javascript" type="text/javascript">
var second = document.getElementById('totalSecond').textContent;

if (navigator.appName.indexOf("Explorer") > -1)
{
second = document.getElementById('totalSecond').innerText;
} else
{
second = document.getElementById('totalSecond').textContent;
}

setInterval("redirect()", 1000);
function redirect()
{
if (second < 0)
{
location.href = 'www.baidu.com'; //go to baidu
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
</script>
</body>
</html>

[/code]

本文出自 “BatterHome” 博客,请务必保留此出处http://batter.blog.51cto.com/3743692/807143
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: