設(shè)置下載不需要倒計(jì)時(shí)cookie(倒計(jì)時(shí)代碼)
更新時(shí)間:2008年11月19日 17:58:09 作者:
利用賦值downvip實(shí)現(xiàn)軟件下載的倒計(jì)時(shí)代碼
<!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設(shè)置下載不需要倒計(jì)時(shí)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.dhdzp.com">腳本之家</a>
</span>
</div>
<script type="text/javascript">
var waitingTime = 10;
var downloadTimer = setInterval("waitForDownload()", 1000);
//Hash 判斷是否需要倒計(jì)時(shí)
if (window.location.hash == "#thunder")
waitingTime = 0;
//cookie判斷是否需要倒計(jì)時(shí)
//獲取cookie字符串
var strCookie=document.cookie;
//將多cookie切割為多個(gè)名/值對(duì)
var arrCookie=strCookie.split("; ");
var downvip;
//遍歷cookie數(shù)組,處理每個(gè)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設(shè)置下載不需要倒計(jì)時(shí)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.dhdzp.com">腳本之家</a>
</span>
</div>
<script type="text/javascript">
var waitingTime = 10;
var downloadTimer = setInterval("waitForDownload()", 1000);
//Hash 判斷是否需要倒計(jì)時(shí)
if (window.location.hash == "#thunder")
waitingTime = 0;
//cookie判斷是否需要倒計(jì)時(shí)
//獲取cookie字符串
var strCookie=document.cookie;
//將多cookie切割為多個(gè)名/值對(duì)
var arrCookie=strCookie.split("; ");
var downvip;
//遍歷cookie數(shù)組,處理每個(gè)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>
您可能感興趣的文章:
- javascript倒計(jì)時(shí)效果代碼,可以方便參數(shù)調(diào)用
- JS 倒計(jì)時(shí)實(shí)現(xiàn)代碼(時(shí)、分,秒)
- Javascript倒計(jì)時(shí)代碼
- 基于jQuery的倒計(jì)時(shí)實(shí)現(xiàn)代碼
- 各種頁面定時(shí)跳轉(zhuǎn)(倒計(jì)時(shí)跳轉(zhuǎn))代碼總結(jié)
- js幾秒以后倒計(jì)時(shí)跳轉(zhuǎn)示例
- android自定義倒計(jì)時(shí)控件示例
- jquery實(shí)現(xiàn)手機(jī)發(fā)送驗(yàn)證碼的倒計(jì)時(shí)代碼
- js實(shí)現(xiàn)網(wǎng)頁倒計(jì)時(shí)、網(wǎng)站已運(yùn)行時(shí)間功能的代碼3例
- 簡單易用的倒計(jì)時(shí)js代碼
- IOS開發(fā)代碼分享之用nstimer實(shí)現(xiàn)倒計(jì)時(shí)功能
- 一個(gè)不錯(cuò)的js html頁面倒計(jì)時(shí)可精確到秒
- 基于jQuery+Cookie實(shí)現(xiàn)的防止刷新的在線考試倒計(jì)時(shí)
相關(guān)文章
使用Mock.js生成前端測(cè)試數(shù)據(jù)
這篇文章主要介紹了使用Mock.js生成前端測(cè)試數(shù)據(jù),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-12-12
uni-app返回上一個(gè)頁面并進(jìn)行頁面刷新的方法
這篇文章主要給大家介紹了關(guān)于uni-app返回上一個(gè)頁面并進(jìn)行頁面刷新的相關(guān)資料,返回上一頁面在uniapp有多種方法,文中給出了詳細(xì)的圖文示例,需要的朋友可以參考下2023-07-07
BootStrap實(shí)現(xiàn)文件上傳并帶有進(jìn)度條效果
這篇文章主要介紹了BootStrap實(shí)現(xiàn)文件上傳并帶有進(jìn)度條效果,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-09-09
javascript實(shí)現(xiàn)數(shù)組最大值和最小值的6種方法
比較數(shù)組中數(shù)值的大小是比較常見的操作,本文主要介紹了javascript實(shí)現(xiàn)數(shù)組最大值和最小值的6種方法,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-05-05

