点击下载链接 弹出页面实现代码
程序员文章站
2023-12-01 14:28:22
复制代码 代码如下:打开下载页面1
<a
onclick=checkopen(this);
href="https://www.jb51.net"
target=_blank>打开下载页面1</a>
<script>
<!--
var original_url = ""
var adurl = new array(9);
var isclick = false;
var adurl_i = 5;
adurl[0] = "https://www.jb51.net";
adurl[1] = "http://www.yuanma51.com/";
adurl[2] = "http://www.baidu.com/";
function selectfrom(ifirstvalue,ilastvalue){
var ichoces = math.abs(ilastvalue - ifirstvalue) + 1;
return math.floor(math.random() * ichoces + ifirstvalue);
}
adurl_i = selectfrom(0,2);
function checkopen(a){
if(adurl_i<9){
if(isclick==false){
original_url = a.href;
a.href = adurl[adurl_i];
isclick = true;
top.location.href = original_url;
}else{
a.href = original_url;
}
}
}
//-->
</script>
复制代码 代码如下:
<a
onclick=checkopen(this);
href="https://www.jb51.net"
target=_blank>打开下载页面1</a>
<script>
<!--
var original_url = ""
var adurl = new array(9);
var isclick = false;
var adurl_i = 5;
adurl[0] = "https://www.jb51.net";
adurl[1] = "http://www.yuanma51.com/";
adurl[2] = "http://www.baidu.com/";
function selectfrom(ifirstvalue,ilastvalue){
var ichoces = math.abs(ilastvalue - ifirstvalue) + 1;
return math.floor(math.random() * ichoces + ifirstvalue);
}
adurl_i = selectfrom(0,2);
function checkopen(a){
if(adurl_i<9){
if(isclick==false){
original_url = a.href;
a.href = adurl[adurl_i];
isclick = true;
top.location.href = original_url;
}else{
a.href = original_url;
}
}
}
//-->
</script>