asp上传带显示的代码
2008-04-26 00:00
381 查看
注意是用到了,下列的演示
<script language="JavaScript" type="text/javascript">
adTime=8;
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
adDiv.left=documentWidth-100;adDiv.top =documentHeight-0;
setTimeout("showAd()",100);}
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
function $(obj){
return document.getElementById(obj);
}
function checkForm(){
if($("file1").value != "")
{
if(/jpg|jpeg|gif|bmp/i.test($("file1").value.match(/\.(\w+)$/)[0]) == false){
alert("您只能上传图片文件");
return false;
}
else
{
return true;
}
}
else
{
alert("您还没有选中需要上传的图片");
return false;
}
}
文件打包下载
<script language="JavaScript" type="text/javascript">
adTime=8;
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
adDiv.left=documentWidth-100;adDiv.top =documentHeight-0;
setTimeout("showAd()",100);}
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
function $(obj){
return document.getElementById(obj);
}
function checkForm(){
if($("file1").value != "")
{
if(/jpg|jpeg|gif|bmp/i.test($("file1").value.match(/\.(\w+)$/)[0]) == false){
alert("您只能上传图片文件");
return false;
}
else
{
return true;
}
}
else
{
alert("您还没有选中需要上传的图片");
return false;
}
}
文件打包下载
相关文章推荐
- asp.net实现上传文件显示本地绝对路径的实例代码
- asp.net实现上传文件显示本地绝对路径的实例代码
- asp上传带显示的代码
- asp.net上传execl文件后,在页面上加载显示(示例代码)
- asp.net上传execl文件后,在页面上加载显示(示例代码)
- asp.net web大文件上传带进度条实例代码
- asp.net上传图片文件自动修改图片大小代码
- ASP.NET 提示框显示及自动隐藏(jquery+后台代码)
- Asp.net图片上传实现预览效果的简单代码
- HTML5上传文件显示进度的实现代码
- asp.net下文件上传和文件删除的代码
- ASP.NET(C#)实现一次性动态上传多张图片的代码(多个文件)
- Asp.Net 上传大文件专题(4)--利用ajax技术显示上传进度
- asp代码 最新新闻显示new图片
- ASP上传代码? 在本机上调试成功,在网络上就不行了
- Asp.Net 上传大文件专题(4)--利用ajax技术显示上传进度
- ASP+JS获取并实时显示服务器时间的代码
- ASP.NET中常用功能代码总结(1)——textBox显示规定行数
- Java动态显示文件上传进度实现代码
- 简单asp分页显示代码