|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
function isLeapYear(sYear){ //年参数错误返回-1 是闰年返回1,不是闰年返回 0 if ((sYear%4==0)&&(sYear%100!=0)||(sYear%400==0)) return true else return false } //得到一个给定的日期中的特定数据信息 a[0]=year a[1]=month a[2]=day //日期格式可以为:年-月-日,年/月/日,年。月。日 function datePart(strDate){ var aDate=new Array var sDate=new String(strDate) if (sDate.search("-")!=-1){ aDate=sDate.split("-") } else if (sDate.search("/")!=-1){ aDate=sDate.split("/") } else if (sDate.search(".")!=-1){ aDate=sDate.split(".") } return aDate } //以下函数判定一个日期的合法性 function isRightDate(strDate) { var dp=new Array dp=datePart(strDate) return isRightDate2(dp[0],dp[1],dp[2]) } function isRightDate2(iYear2,iMonth2,iDay2) { var iYear=parseInt(iYear2) var iMonth=parseInt(iMonth2) var iDay=parseInt(iDay2) if (iYear<1900) return false; if (iMonth<1||iMonth>12) return false; if (iDay<1||iDay>31) return false; if (iMonth==2) { if (isLeapYear(iYear))//假如是闰年 { if (iDay>29) return false; } else { if (iDay>28) return false; } } else { if (iMonth==4||iMonth==6||iMonth==9||iMonth==11) { if (iDay>30) return false; } if (iMonth==1||iMonth==3||iMonth==5||iMonth==7||iMonth==8||iMonth==10||iMonth==12) { if (iDay>31) return false; } } return true; } //无条件关闭浏览器窗口 function CloseWindow() { var ua=navigator.userAgent var ie=navigator.appName=="Microsoft Internet Explorer"?true:false if(ie){ var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE ")))) if(IEversion< 5.5){ var str = \\\'<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">\\\' str += \\\'<param name="Command" value="Close"></object>\\\'; document.body.insertAdjacentHTML("beforeEnd", str); document.all.noTipClose.Click(); } else{ window.opener =null; window.close(); } } else{ window.close() } } 返回类别: 教程 上一教程: 一个简朴聊天室的建立.(供学习参考) 下一教程: 菜鸟十天学会ASP教程之第一天:安装调试ASP的环境 您可以阅读与"面向对象的ASP编程之九-客户器端函数"相关的教程: · 面向对象的ASP编程之八-服务器端函数 · 面向对象的ASP编程之四-一些常用的函数 · 面向对象的ASP编程之六-用于自动显示RECORDSET的表格 · 面向对象的ASP编程之五-ADODB的类封装 · ASP面向对象编程探讨及比较 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |