当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 点击下载链接 弹出页面实现代码

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 点击下载链接 弹出页面实现代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-10   浏览: 428 ::
收藏到网摘: n/a

点击下载地址链接 弹出页面实现代码,可以用来弹出广告商的广告。
复制代码 代码如下:

<A
onclick=checkopen(this);
href="http://www.ruanchen.com"
target=_blank>打开下载页面1</A>
<script>
<!--
var original_url = ""
var adurl = new Array(9);
var isclick = false;
var adurl_i = 5;
adurl[0] = "http://www.ruanchen.com";
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>