asp上傳帶顯示的代碼
更新時間:2008年04月26日 21:35:43 作者:
一個不錯的asp上傳類代碼,可以顯示上傳進(jìn)度
注意是用到了,下列的演示
<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;
}
}
文件打包下載
相關(guān)文章
asp 批量刪除選中的多條記錄的實(shí)現(xiàn)代碼
如果需要刪除記錄,一條一條的刪比較耗時,所以批量刪除記錄是個不錯的功能,原理就是利用asp數(shù)組來實(shí)現(xiàn)。2011-06-06asp 實(shí)現(xiàn)對SQL注入危險字符進(jìn)行重編碼處理的函數(shù)
asp 實(shí)現(xiàn)對SQL注入危險字符進(jìn)行重編碼處理的函數(shù)...2007-08-08asp實(shí)現(xiàn)檢查ip地址是否為內(nèi)網(wǎng)或者私有ip地址的代碼分享
這篇文章主要介紹了asp實(shí)現(xiàn)檢查ip地址是否為內(nèi)網(wǎng)或者私有ip地址的代碼分享,給同樣在找IP判斷的使用,需要的朋友可以參考下2014-08-08C語言數(shù)組添加和刪除元素的實(shí)現(xiàn)
這篇文章主要介紹了C語言數(shù)組添加和刪除元素的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-02-02ASP自動獲取漢字首字母函數(shù)(支持UTF-8/GB2312)
ASP獲取漢字首字母函數(shù)分享,分GB2312編碼和UTF-8編碼兩種,每次傳入一個漢字或一個字符。(具體如何獲得字符串中的一個字符,就大家自己想啦2007-08-08通過Response.Flush()實(shí)現(xiàn)下載失敗的解決方法
Response.Flush()實(shí)現(xiàn)對服務(wù)端文件的下載時,會失敗,不能正常彈出IE下載框,通過測試發(fā)現(xiàn)時瀏覽器的安全設(shè)置問題,如下操作便可解決2013-08-08