<%@?page?language="java"?import="java.util.*"?pageEncoding="utf-8"%>
<%
String?path?=?request.getContextPath();
String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN">
<html>
??<head>
????<base?href="<%=basePath%>">
????
????<title>My?JSP?'index.jsp'?starting?page</title>
<meta?http-equiv="pragma"?content="no-cache">
<meta?http-equiv="cache-control"?content="no-cache">
<meta?http-equiv="expires"?content="0">????
<meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3">
<meta?http-equiv="description"?content="This?is?my?page">
<!--
<link?rel="stylesheet"?type="text/css"?href="styles.css">
-->
<script?type="text/javascript">
?? function?getRandom(){
?? Document().getElementById("nn").innerHTML=?Math.round(Math.random()*10);
?? }
??</script>
??</head>
??
??<body>
????<p?id="nn">0</p>
???<input?type="button"?value="刷新"?onclick="getRandom()">
??</body>
</html>
取一個(gè)隨機(jī)數(shù),這段代碼有問(wèn)題嗎?這是JSP頁(yè)面 不是 HTML
qq_小藝軒_03563899
2017-02-23 22:03:16