設(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>下載地址頁(yè)面</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.dbjr.com.cn">腳本之家</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>下載地址頁(yè)面</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.dbjr.com.cn">腳本之家</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)代碼
- 各種頁(yè)面定時(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)頁(yè)倒計(jì)時(shí)、網(wǎng)站已運(yùn)行時(shí)間功能的代碼3例
- 簡(jiǎn)單易用的倒計(jì)時(shí)js代碼
- IOS開(kāi)發(fā)代碼分享之用nstimer實(shí)現(xiàn)倒計(jì)時(shí)功能
- 一個(gè)不錯(cuò)的js html頁(yè)面倒計(jì)時(shí)可精確到秒
- 基于jQuery+Cookie實(shí)現(xiàn)的防止刷新的在線考試倒計(jì)時(shí)
相關(guān)文章
Javascript獲取隨機(jī)數(shù)的實(shí)現(xiàn)方法
下面小編就為大家?guī)?lái)一篇Javascript獲取隨機(jī)數(shù)的實(shí)現(xiàn)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-06-06Sublime?Text?3插件Minify的安裝與使用(js代碼壓縮)
這篇文章主要介紹了Sublime?Text?3插件Minify的安裝與使用(js代碼壓縮),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-01-01微信小程序以7天為周期連續(xù)簽到7天功能效果的示例代碼
這篇文章主要介紹了微信小程序以7天為周期連續(xù)簽到7天功能效果的示例代碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-08-08Javascript表單特效之十大常用原理性樣例代碼大總結(jié)
開(kāi)頭說(shuō)這個(gè)常用原理性樣例,大家可能不太清楚,這篇文章主要是針對(duì)實(shí)際開(kāi)發(fā)中常用的一些代碼分析,主要是針對(duì)表單處理方法的一些資料,推薦大家收藏2016-07-07js for循環(huán)倒序輸出數(shù)組元素的實(shí)例
下面小編就為大家?guī)?lái)一篇js for循環(huán)倒序輸出數(shù)組元素的實(shí)例。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-03-03javascript getBoundingClientRect() 來(lái)獲取頁(yè)面元素的位置的代碼[修正版]
該方法已經(jīng)不再是IE Only了,F(xiàn)F3.0+和Opera9.5+已經(jīng)支持了該方法,可以說(shuō)在獲得頁(yè)面元素位置上效率能有很大的提高,在以前版本的Opera和Firefox中必須通過(guò)循環(huán)來(lái)獲得元素在頁(yè)面中的絕對(duì)位置。2009-05-05