javascript的日期例子
<script language="JavaScript">
<!--
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var monthname =
new Array ("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月" );
document.write("<font color=0000ff>"+year +"年");
document.write(monthname[month]);
document.write(date + "日 ");
document.write(dayname[day]+" "+"</font>");
document.write("<br></font>");
//-->
</script>
相关文档:
javascript parseInt is broken
I was debugging some strange errors in a date conversion function I was writing, and I stumbled upon something that amazed me... a strange bug in parseInt
>>>parseInt('06')
6
>>>parseInt('07')
7
>>>parseInt('08')
0
>>>parseInt ......
嵌入式SGF查看和编辑器
EidoGo Player
(SGF viewer and editor) 是一款开源(AGPLv3
许可)纯javascript+css编写、在浏览器内运行的围棋打谱、编辑软件。
可嵌入到任何页面,提供打谱、编辑SGF棋谱。
源代码:http://code.google.com/p/eidogo/
例子:第24届天元战本赛第1轮 2010-01-27 常昊vs罗洗河 白中盘胜
(
......
用arguments对象检测传递给函数的参数个数:arguments.length
function test(){
if(arguments.length == 1)
alert(arguments[0] + ",你好");
else if(arguments.length == 2)
alert(a ......
本文来自http://q.yesky.com/group/review-17634017.html,另外还添加一些里面技术的链接。
离线事件(Online and offline events):
https://developer.mozilla.org/En/Online_and_offline_events
https://bug336359.bugzilla.mozilla.org/attachment.cgi?id=220609
http://ejohn.org/blog/offline-events/
postMessage ......