为什么我写的一个显示系统时间的小脚本不能在这里显示出来?
还有就是如何使用DOM的getelementbyid方法显示系统时间?
<SCRIPT LANGUAGE="JavaScript">
<!--
var timerID = null
var timerRunning = false
function showtime(){
var today,hour,second,minute,year,month,date;
var strDate ;
today=new Date();
var n_day = today.getDay();
switch (n_day)
{
case 0:{
strDate = "星期日"
}break;
case 1:{
strDate = "星期一"
}break;
case 2:{
strDate ="星期二"
}break;
case 3:{
strDate = "星期三"
}break;
case 4:{
strDate = "星期四"
}break;
case 5:{
strDate = "星期五"
}break;
case 6:{
strDate = "星期六"
}break;
case 7:{
strDate = "星期日"
}break;
}
year = today.getYear();
month = today.getMonth()+1;
date = today.getDate();
hour = today.getHours();
minute =today.getMinutes();
second = today.getSeconds();
if(month<10) month="0"+month;
if(date<10) date="0"+date;
if(hour<10) hour="0"+hour;
if(minute<10) minute="0"+minute;
if(second<10) second="0"+second;
timeValue =year + " 年 " + month + " 月 " + date + " 日 " + strDate +" " + hour + ":" + minute + ":" + second
document.GG.MM.value = timeValue
wuxingjia= setTimeout("showtime()",1000)
}
//-->
</SCRIPT>
</HEAD> <BODY onLoad="showtime()">
<FORM NAME="GG" onSubmit="0">
<INPUT TYPE="text" NAME="MM" SIZE=40 >
</FORM>
1、取出刚刚插入(删除)的数据SELECT 字段名 FROM INSERTED(DELETED)
2、对于UPDATE实际上是先DELETE然后再INSERT所以如果想得到UPDATE前后的数据值,应该先从DELETED取出,然后从INSERTED取出;
3、IF UPDATE(列名)可以判断更新或插入哪一个字段的值;
4、@@ROWCOUNT可以判断上一行查询操作得到的列数;
5、给变量赋值用SET @ZQB = 13;
6、察看是否有符合条件的记录IF EXISTS (SELECT name FROM sysobjects WHERE name = 'reminder' AND type = 'TR');
7、定义游标,如下:
DECLARE c1 CURSOR FOR
SELECT emp_mgr.emp
FROM emp_mgr, inserted
WHERE emp_mgr.emp = inserted.mgr
OPEN c1
FETCH NEXT FROM c1 INTO @e--从游标中取出数据
WHILE @@fetch_status = 0--判断是否到最后
BEGIN
UPDATE emp_mgr
SET emp_mgr.NoOfReports = emp_mgr.NoOfReports + 1 -- Add 1 for newly
WHERE emp_mgr.emp = @e -- added employee.
FETCH NEXT FROM c1 INTO @e
END
CLOSE c1
DEALLOCATE c1--删除游标引用