使用javascript制作基于时间的问候语
代码:
<%@ language="javascript" %><!DOCTYPE html>
<html>
<body>
<%
var d=new Date()
var h=d.getHours()
Response.Write("<p>")
Response.Write(d)
Response.Write("</p>")
if (h<12)
{
Response.Write("Good Morning!")
}
else
{
Response.Write("Good day!")
}
%>
</body>
</html>
结果:
Fri Sep 20 23:08:38 EDT 2013
Good day!
相关文章