一个简单的小编程例子

来源:百度知道 编辑:UC知道 时间:2024/06/04 18:49:00
<%@language="vbscript" codepage="936"%>
<html>
<head>
<title>
a sample based on Vbscript
</title>
</head>
<body>
<%
y=Year(date())
m=Month(date())
d=Day(date())
tm="您访问的时间是:" & y & "年" & m & "月" & d & "日"
response.write tm
%>
</body>
</html>
大伙看这个小例子,它是一个基于vbscript的ASP,旨在输出系统当前时间!我想要的是大伙把这个例子给改成基于Javascript的,功能不变,谢谢了!
我补充下,我要的是把原来的改成是基于javascript的ASP程序!我给出的那段代码保存是.asp的扩展名!

<html>
<head>
<title>
a sample based on javascript
</title>
</head>
<body>
<script type="text/javascript">
var d=new Date();
document.write("您访问的时间是:"+d.getYear()+"年"+(d.getMonth()

+1)+"月"+d.getDate()+"日");
</script>
</body>
</html>

<html>
<head>
<title>
a sample based on Vbscript
</title>
</head>
<body>
<script language = "javascript">
y=Year(date())
m=Month(date())
d=Day(date())
tm="您访问的时间是:" & y & "年" & m & "月" & d & "日"
response.write tm
</script>
</body>
</html>