设置下载不需要倒计时cookie(倒计时代码)
2008-11-19 00:00
423 查看
<!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" />
<meta http-equiv="Content-Language" content="gb2312" />
<title>下载地址页面</title>
<script type="text/javascript">
//20080824设置下载不需要倒计时cookie
document.cookie="downvip=888";
String.prototype.trim = function ()
{
return this.replace(/^\s+|\s+$/, '');
}
var IE_all_cache = new Object();
function IE_getElementById(id)
{
if (IE_all_cache[id] == null)
{
IE_all_cache[id] = document.all[id];
}
return IE_all_cache[id];
}
if (document.all)
{
if (!document.getElementById)
{
document.getElementById = IE_getElementById;
}
}
function waitForDownload()
{
if (waitingTime <= 0)
{
document.getElementById("wait_to_download").style.display = 'none';
document.getElementById("download_link").style.display = 'inline';
clearInterval(downloadTimer);
}
else
{
document.getElementById("remaining_secs").innerHTML = waitingTime;
}
waitingTime --;
}
if (window.parent != window)
{
window.parent.location = window.location;
}
</script>
</head>
<body>
<div class="description">
</div>
<div class="down_box">
<span id="wait_to_download">下载地址列表载入中 <span id="remaining_secs">10</span></span>
<span id="download_link" style="display: none; ">
<a href="http://www.jb51.net">脚本之家</a>
</span>
</div>
<script type="text/javascript">
var waitingTime = 10;
var downloadTimer = setInterval("waitForDownload()", 1000);
//Hash 判断是否需要倒计时
if (window.location.hash == "#thunder")
waitingTime = 0;
//cookie判断是否需要倒计时
//获取cookie字符串
var strCookie=document.cookie;
//将多cookie切割为多个名/值对
var arrCookie=strCookie.split("; ");
var downvip;
//遍历cookie数组,处理每个cookie
for(var i=0;i<arrCookie.length;i++){
var arr=arrCookie[i].split("=");
//找到名称为downvip的cookie,并返回它的值
if("downvip"==arr[0]){
downvip=arr[1];
break;
}
}
if(downvip == 888){
waitingTime = 0;
}
</script>
</body>
</html>
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
<title>下载地址页面</title>
<script type="text/javascript">
//20080824设置下载不需要倒计时cookie
document.cookie="downvip=888";
String.prototype.trim = function ()
{
return this.replace(/^\s+|\s+$/, '');
}
var IE_all_cache = new Object();
function IE_getElementById(id)
{
if (IE_all_cache[id] == null)
{
IE_all_cache[id] = document.all[id];
}
return IE_all_cache[id];
}
if (document.all)
{
if (!document.getElementById)
{
document.getElementById = IE_getElementById;
}
}
function waitForDownload()
{
if (waitingTime <= 0)
{
document.getElementById("wait_to_download").style.display = 'none';
document.getElementById("download_link").style.display = 'inline';
clearInterval(downloadTimer);
}
else
{
document.getElementById("remaining_secs").innerHTML = waitingTime;
}
waitingTime --;
}
if (window.parent != window)
{
window.parent.location = window.location;
}
</script>
</head>
<body>
<div class="description">
</div>
<div class="down_box">
<span id="wait_to_download">下载地址列表载入中 <span id="remaining_secs">10</span></span>
<span id="download_link" style="display: none; ">
<a href="http://www.jb51.net">脚本之家</a>
</span>
</div>
<script type="text/javascript">
var waitingTime = 10;
var downloadTimer = setInterval("waitForDownload()", 1000);
//Hash 判断是否需要倒计时
if (window.location.hash == "#thunder")
waitingTime = 0;
//cookie判断是否需要倒计时
//获取cookie字符串
var strCookie=document.cookie;
//将多cookie切割为多个名/值对
var arrCookie=strCookie.split("; ");
var downvip;
//遍历cookie数组,处理每个cookie
for(var i=0;i<arrCookie.length;i++){
var arr=arrCookie[i].split("=");
//找到名称为downvip的cookie,并返回它的值
if("downvip"==arr[0]){
downvip=arr[1];
break;
}
}
if(downvip == 888){
waitingTime = 0;
}
</script>
</body>
</html>
相关文章推荐
- 设置下载不需要倒计时cookie(倒计时代码)
- Eclipse自动补全设置与Eclipse源代码下载 以前使用VisualStudio和Sublime写代码的时候有很完善的代码提示,但是最近开始使用Eclipse弄JAVA的时候发现它的代码提示不
- 设置和读取cookie的javascript代码
- Android自带的下载功能,不需要断点续传、大文件下载、通知栏显示等窝心问题,四行代码全部搞定(经测)
- git 设置不需要输入密码, 去除 fetch / pull 代码每次都需要输入密码的烦恼
- cookie代码下载
- git 设置不需要输入密码, 去除 fetch / pull 代码每次都需要输入密码的烦恼
- 错误代码2104:无法下载Silverlight应用程序。请查看Web服务器设置
- Windows 和 Linux下使用socket下载网页页面内容(可设置接收/发送超时)的代码
- 按钮背景代码中设置和倒计时的使用
- 设置cookie倒计时让让表单自动提交
- winfrom 安装包如何在代码中设置安装路径,而不需要获取[TARGETDIR]属性来获取
- 转 错误代码2104:无法下载Silverlight应用程序。请查看Web服务器设置
- git 设置 key 到服务器,同步代码不需要输入用户名和密码
- cookie设置时间倒计时
- Windows 和 Linux下使用socket下载网页页面内容(可设置接收/发送超时)的代码
- git 设置不需要输入密码, 去除 fetch / pull 代码每次都需要输入密码的烦恼
- symbianoggplay从cvs上下载代码的设置
- Cookie 获取,设置的简短代码
- 【JavaScript代码实现四】获取和设置 cookie