開啟startup.bat
在webapps底下建一個test01.jsp檔案
鍵入
<%@page contentType="text/html; charset=utf-8" %>
<%
request.setCharacterEncoding("UTF-8");
String title = request.getParameter("TITLE");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/modaldbox.js"></script>
<link rel="stylesheet" href="js/modaldbox.css" type="text/css" />
<title>AJAX</title>
</head>
<script type="text/javascript" charset="UTF-8">
function AllSubmit(obj){
REQFORM.TYPE.value=obj;
REQFORM.submit();
}
</script>
<body>
<%=title%>
<form action="t01.jsp" method="POST" name="REQFORM">
<input type="hidden" name="TYPE" value="TEMP">
<div align="center">
<table border="1" width="1128" cellspacing="0" cellpadding="2" id="main_table">
<tr>
<td>
<br /><b><span id="txt"></span></b><br />
結果:
<input type="TEXT" name="TITLE" value="">
<br />
送出:
<input type="TEXT" name="RESULT" value="">
<br /><br />
<button type="button" onClick="AllSubmit('ADD')"> add </button>
<br />
</td>
</tr>
</table>
</form>
</body>
</html>
開啟瀏覽器鍵入 http://localhost/test01/t01.jsp 看一下結果
沒有留言:
張貼留言