ASP uploads code with display

Source: Internet
Author: User

Note that the following example is used:
<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. soraddiv. style ');
Else if (NS) addiv = eval ('document. Layers ["soraddiv"] ');
Else if (W3) addiv = eval ('document. getelementbyid ("soraddiv"). 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;
Export entheight = Document. Body. offsetheight/2 + document. Body. scrollTop-20 ;}
Else if (NS) {documentwidth = Window. innerwidth/2 + window. pageXOffset-20;
Export entheight = Window. innerheight/2 + window. pageYOffset-20 ;}
Else if (W3) {documentwidth = self. innerwidth/2 + window. pageXOffset-20;
Export entheight = 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! = "")
{< br> If (/jpg | JPEG | GIF | BMP/I. test ($ ("file1 "). value. match (/\. (\ W +) $/) [0]) = false) {
alert ("You can only upload image files");
return false;
}< br> else
{< br> return true;
}< BR >}< br> else
{< br> alert ("You have not selected the image to be uploaded");
return false;
}< BR >}< br> package and download a file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.