需要写两次延时以调用函数, function startCount() {
document.getElementById('count').value=num;
num=num+1;
setTimeout(startCount,1000);
}
setTimeout(startCount,1000);
document.getElementById('count').value=num;
num=num+1;
setTimeout(startCount,1000);
}
setTimeout(startCount,1000);
2015-01-11
attime= time.getHours()+":"+("0"+time.getMinutes()).substring(("0"+time.getMinutes()).length-2)+":"+("0"+time.getSeconds()).substring(("0"+time.getSeconds()).length-2);
2015-01-11
attime= time.getHours()+":"+time.getMinutes()+":"+("0"+time.getSeconds()).substring(("0"+time.getSeconds()).length-2);
2015-01-11
var strDay = ['日','一','二','三','四','五','六'];
var strDate = mydate.getFullYear()+"年"+(parseInt(mydate.getMonth())+1)+"月"+mydate.getDate()+"日"+" 星期"+strDay[mydate.getDay()];
var strDate = mydate.getFullYear()+"年"+(parseInt(mydate.getMonth())+1)+"月"+mydate.getDate()+"日"+" 星期"+strDay[mydate.getDay()];
不知道大家有没有遇到这样的问题,我用dreamweaver写了一下右面的代码,发现了一个奇怪的现象:一定要把
var time=new Date();
document.getElementById("clock").value = time;
这两行代码包到function clock()里面再加定时器,下面的单行文本域里面才有时间显示,我如果不加function,单独写这两行代码,就什么都不显示,这是为什么呢?直接执行这两行代码和把它放到函数里再调用,结果不应该是一样的码?
var time=new Date();
document.getElementById("clock").value = time;
这两行代码包到function clock()里面再加定时器,下面的单行文本域里面才有时间显示,我如果不加function,单独写这两行代码,就什么都不显示,这是为什么呢?直接执行这两行代码和把它放到函数里再调用,结果不应该是一样的码?
2015-01-11
document.write(Math.ceil(3.3) + "<br>");
document.write(Math.ceil(-0.1) + "<br>");
document.write(Math.ceil(-9.9) + "<br>");
document.write(Math.ceil(8.9) + "<br>");
document.write(Math.ceil(-0.1) + "<br>");
document.write(Math.ceil(-9.9) + "<br>");
document.write(Math.ceil(8.9) + "<br>");
2015-01-11
document.write(mystr.substr(6,6)+ "<br />");
document.write(mystr.substr(0,5));
document.write(mystr.substr(0,5));
2015-01-11
document.write(mystr.substring(6)+ "<br />");
document.write(mystr.substring(0,5));
document.write(mystr.substring(0,5));
2015-01-11