asp.net use asp.net for a long time, found that still can not be separated from JavaScript, whether in the foreground code or backstage, always to the key found JavaScript is indeed a rare good friend, Next to introduce a few in the use of asp.net such as OA or CRM, such as commonly used functions, can also be called Skills bar.
1, the default initialization of the page to maximize the screen
<script language= "JavaScript" >
if (window. Event)
Document.captureevents (Event.mouseup);
function Nocontextmenu ()
{
Event.cancelbubble = True
Event.returnvalue = false;
return false;
}
function Norightclick (e)
{
if (window. Event)
{
if (E.which = 2 | | e.which = 3)
return false;
}
Else
if (Event.button = 2 | | event.button = 3)
{
Event.cancelbubble = True
Event.returnvalue = false;
return false;
}
}
Document.oncontextmenu = Nocontextmenu; For ie5+
Document.onmousedown = Norightclick; For all others
</script>
3, the display date format is: Wednesday, April 21, 2004 lunar April 23 Lunar New Year March first three
<script language= "JavaScript" >
<!--
var bsyear;
var bsdate;
var Bsweek;
var arrlen=8;
var svalue=0;
var dayiy=0;
var miy=0;
var iyear=0;
var dayim=0;
var spd=86400;
var year1999= "30;29;29;30;29;29;30;29;30;30;30;29"; 354
var year2000= "30;30;29;29;30;29;29;30;29;30;30;29"; 354
var year2001= "30;30;29;30;29;30;29;29;30;29;30;29;30"; 384
var year2002= "30;30;29;30;29;30;29;29;30;29;30;29"; 354
var year2003= "30;30;29;30;30;29;30;29;29;30;29;30"; 355
var year2004= "29;30;29;30;30;29;30;29;30;29;30;29;30"; 384
var year2005= "29;30;29;30;29;30;30;29;30;29;30;29"; 354
var year2006= "30;29;30;29;30;30;29;29;30;30;29;29;30";
var month1999= "first month; February; March; April; May; June; July; August; September; October; November; December"
var month2001= "first month; February; March; April; April; May; June; July; August, September;
var month2004= "First month, February, February, March, April, May, June, July, August, September"
var month2006= "First month, February; March; April; May; June; July; July; August; September;
var dn= "; The Hansi of the Duanwu; arrest; when初七because; day; Yanji; 11; 15; 16; 17 18; 19; 20; 14 21; 12; 22; 23.24; 25; 26; 13
var yn=new Array (Arrlen); The name of the lunar year
Yn[0]= "The years of their own;" Yn[1]= "The Year of Geng Chen"; Yn[2]= "Singonan";
Yn[3]= "The year of the Siren"; yn[4]= "Year"; Yn[5]= "Jia Shen Year";
Yn[6]= "B unitary year"; Yn[7]= "The Year of the" C Xu;
var d=new Date ();
var yy=d.getyear ();
var mm=d.getmonth () +1;
var dd=d.getdate ();
var ww=d.getday ();
var ss=parseint (D.gettime ()/1000);
if (yy<100) yy= "+yy";
for (i=0;i<arrlen;i++)
if (Ss>=ys[i]) {
Iyear=i;
Svalue=ss-ys[i]; The number of seconds in the year
}
Dayiy=parseint (SVALUE/SPD) +1; Days of the Year
var dpm=year1999;
if (iyear==1) dpm=year2000;
if (iyear==2) dpm=year2001;
if (iyear==3) dpm=year2002;
if (iyear==4) dpm=year2003;
if (iyear==5) dpm=year2004;
if (iyear==6) dpm=year2005;
if (iyear==7) dpm=year2006;
Dpm=dpm.split (";");
var mn=month1999;
if (iyear==2) mn=month2001;
if (iyear==5) mn=month2004;
if (iyear==7) mn=month2006;
Mn=mn.split (";");
var dn= "; The Hansi of the Duanwu; arrest; when初七because; day; Yanji; 11; 15; 16; 17 18; 19; 20; 14 21; 12; 22; 23.24; 25; 26; 13
Dn=dn.split (";");
Dayim=dayiy;
var total=new Array (13);
Total[0]=parseint (Dpm[0]);
for (i=1;i<dpm.length-1;i++) Total[i]=parseint (Dpm[i]) +total[i-1];
for (i=dpm.length-1;i>0;i--)
if (Dayim>total[i-1]) {
DAYIM=DAYIM-TOTAL[I-1];
Miy=i;
}
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