1
在JavaScript函数jsp我试图打印date.But它不会被打印。这是为什么?日期应该在h1标签中的文本之前打印。但问题是日期没有打印!这是为什么?日期没有打印:为什么这样?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP - 1</title>
<script>
function jsp() {
<%= new java.util.GregorianCalendar().getTime().toString() %>
}
</script>
</head>
<body>
<h1>
Was I printed first ? Or is it the date... ..
</h1>
<script type="text/javascript">
setTimeout(jsp,2000);
</script>
</body>