在javascript函数jsp中,我试图打印日期。但它没有被打印出来。为什么会这样?日期应在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>