<script language=javascript>
Date.prototype.toNormalString=function()
{
return this.getYear()+"-"+((this.getMonth()==0)?"1":this.getMonth())+"-"+this.getDate();
}
var str="2006-06-01";
var strArray=str.split("-");
var strNewDateArray=new Array();
var temp=strArray[1];
temp=(temp.substr(0,1)=="0")?temp.substr(1):temp
for(var i=0;i<4;i++)
{
temp=(parseInt(temp)+parseInt(6))
strNewDate=new Date(strArray[0],temp,strArray[2]);
strNewDateArray.push(strNewDate.toNormalString());
}
alert(strNewDateArray)
</script>
Date.prototype.toNormalString=function()
{
return this.getYear()+"-"+((this.getMonth()==0)?"1":this.getMonth())+"-"+this.getDate();
}
var str="2006-06-01";
var strArray=str.split("-");
var strNewDateArray=new Array();
var temp=strArray[1];
temp=(temp.substr(0,1)=="0")?temp.substr(1):temp
for(var i=0;i<4;i++)
{
temp=(parseInt(temp)+parseInt(6))
strNewDate=new Date(strArray[0],temp,strArray[2]);
strNewDateArray.push(strNewDate.toNormalString());
}
alert(strNewDateArray)
</script>
<input type="text" name="d" value="2006-06-01"/>
<select name="s"></select>
<input type="button" value="output" onclick="o()"/>
</form>
<script language="javascript">
<!--
function o(){
arr = document.forms[0].d.value.split("-");
old = new Date(arr[0],parseInt(arr[1],10)-1,arr[2]);
for(i=6;i<=6*5;i+=6)
{
old.setMonth(old.getMonth()+6);
m = String(old.getMonth()+1).length == 1 ? "0" + String(old.getMonth()+1) : old.getMonth()+1;
d = String(old.getDate()).length == 1 ? "0" + String(old.getDate()) : old.getDate();
date = old.getFullYear() + "-" + m + "-" + d;
document.forms[0].s.options.add( new Option(date,date) );
}
}
//-->
</script>
我进linux系统时出来一个提示:
您的回话只持续不到10秒钟,如果您没有注销,这就意味着安装可能出现问题或者您的磁盘 空间已耗尽可以试试以某个failsafe回话登陆以查看是否可以解决次问题。
s是select元素的id,你那个用户自定义页面里头的下拉框元素id也叫s么?
-------------------------------------document.getElementById("objTx").value
document.getElementById("objDdl").appendChild()