惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
H
Help Net Security
V
Visual Studio Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
The Cloudflare Blog
Martin Fowler
Martin Fowler
D
Docker
腾讯CDC
F
Fortinet All Blogs
雷峰网
雷峰网
GbyAI
GbyAI
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - 叶小钗

博客园 - qqhe325

一个js游戏 向del.icio.us学习 lucene.net优化总结 Fxcop使用笔记 web service 记录1 自定义加密web.config实验记录 DTC:该伙伴事务管理器已经禁止了他对远程/网络事务的支持 C#基础- 抽象类,静态类 img的onload事件 当图片路径超出网站根目录时 vs2005宏的问题 asp.net 2.0 access 未指定的错误 oledbparameter在update时出错不报错 grove 小例子 delegate和event例子 你试图打开的项目是Web项目,请指定URL路径 asp.net 在分析向此请求提供服务所需资源时出错 策略模式 我们是怎样的一代人[转]
js自动加载日期类
qqhe325 · 2007-09-17 · via 博客园 - qqhe325

  1 // JScript 文件
  2 //Zeit:2007_01_11
  3 //Ort:sh
  4 //Tunesmith:a4647
  5 //Funktion:自动加载日期类,不需要验证日期的正确性,在原下拉类增加自动加载日期能力
  6 //忘了是从哪找的一个自动加载下一级的类,我给加上了自动加载正确的日期
  7 function daten(sel)    //choose date
  8 
  9   var me=this;
 10   this.$=function(o){
 11   return document.getElementById(o);
 12   }
 13   this.sub =function(i,vip){
 14      for (var j=i+1; j<sel.length; j++)
 15      {
 16         me.$(sel[j]).length = 0;
 17         me.$(sel[j]).options[0= new Option("请选择""");
 18      }
 19      if(i=='-1')
 20      {
 21        var today=new Date();
 22        for(var k=today.getYear()-4;k<today.getYear()+4;k++)
 23        me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 24      }
 25      if(vip.length==4)
 26      {
 27        for(var k=1;k<13;k++)
 28        {
 29        me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 30        }
 31      
 32      }
 33      if(i=='1')
 34      {
 35        switch(vip)
 36        {
 37        //case '1','3','5','7','8','10','12':
 38        case '1':
 39        case '3':
 40        case '5':
 41        case '7':
 42        case '8':
 43        case '10':
 44        case '12':
 45            for(var k=1;k<=31;k++)
 46            {
 47              me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 48            }
 49        
 50            break;
 51        case '4':
 52        case '6':
 53        case '9':
 54        case '11':
 55            for(var k=1;k<=30;k++)
 56            {
 57              me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 58            }
 59        
 60            break;
 61        case '2':
 62            var boolleapyear=false;
 63            if(((me.$(sel[0]).value)%100)==0){
 64              if(((me.$(sel[0]).value)%400)==0)
 65              boolleapyear=true;
 66            }
 67            else{
 68              if(((me.$(sel[0]).value)%4)==0)
 69              boolleapyear=true;
 70            }
 71            if(boolleapyear)
 72            {
 73             for(var k=1;k<=29;k++)
 74            {
 75              me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 76            }
 77          
 78            }
 79            else
 80            {
 81             for(var k=1;k<=28;k++)
 82            {
 83              me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(k,k);
 84            }
 85         
 86            }
 87         
 88            break;
 89        }
 90    
 91           
 92      }
 93   }
 94   this.init = function(){
 95     me.sub(-1,0);
 96    for (var i=0; i<sel.length; i++)//i<sel.length-1
 97    {
 98        me.$(sel[i]).onchange = function()
 99       {
100          //alert('b');
101         
102          for (i=0;me.$(sel[i])!=this; i++);
103          
104          me.sub(i, me.$(sel[i]).value);
105          //alert('a');
106      
107          
108       }
109    }
110 }
111 this.init();
112 }
113