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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

博客园 - 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