<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<title>首页</title>
</head>
<body>
<li class="todaytime">
<script>
var week, day, month, year
function initArray() {
this.length = initArray.arguments.length
for(var i = 0; i < this.length; i++)
this[i + 1] = initArray.arguments[i]
};
var LastModDate = new Date();
var WeekArray = new initArray("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var MonthArray = new initArray("1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月");
day = LastModDate.getDate() + "日";
year = LastModDate.getFullYear() + "年";
week = WeekArray[(LastModDate.getDay() + 1)];
month = MonthArray[(LastModDate.getMonth() + 1)];
document.write(year, month, day, " ", week);
</script>
</li>
</body>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<title>首页</title>
</head>
<body>
<li class="todaytime">
<script>
var week, day, month, year
function initArray() {
this.length = initArray.arguments.length
for(var i = 0; i < this.length; i++)
this[i + 1] = initArray.arguments[i]
};
var LastModDate = new Date();
var WeekArray = new initArray("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var MonthArray = new initArray("1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月");
day = LastModDate.getDate() + "日";
year = LastModDate.getFullYear() + "年";
week = WeekArray[(LastModDate.getDay() + 1)];
month = MonthArray[(LastModDate.getMonth() + 1)];
document.write(year, month, day, " ", week);
</script>
</li>
</body>
</html>
通过jquery动态向表格添加数据
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-2.0.0.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<table border=" cellspacing=" " cellpadding=" ">
<thead>
<tr>
<th>产品</th>
<th>付款日期</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr>
<th>手机</th>
<th id="thedata"></th>
<th>快递中</th>
</tr>
</tbody>
</table>
</body>
<script type="text/javascript">
var thedata = document.getElementById("thedata");
$(thedata).text(new Date().toLocaleDateString());
alert(thedata);
</script>
</html>