<%@ 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" src="js/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function (){
var res = "";
$("[type='button']").click(function(){
res += $(this).val();
$("#d1").val(res);
});
$("#dy").click(function (){
var sul = $("#d1").val();
var re = eval(sul);
$("#d2").val(re);
});
$("#qk").click(function (){
$("#d1").val("");
$("#d2").val("");
res = "";
});
});
</script>
</head>
<body>
<input type="text" id="d1"><br>
<input type="button" value="1">
<input type="button" value="2">
<input type="button" value="3">
<input type="button" value="+"><br>
<input type="button" value="4">
<input type="button" value="5">
<input type="button" value="6">
<input type="button" value="-"><br>
<input type="button" value="7">
<input type="button" value="8">
<input type="button" value="9">
<input type="button" value="*"><br>
<input type="button" value="0">
<input type="button" value=".">
<button id="dy">=</button>
<input type="button" value="/"><br>
<button id="qk">清空</button><br>
<input type="text" id="d2"><br>
</body>
</html>
再强烈的阳光,也不曾洞穿大地,有人的地方,就会有光与影。
——国王陛下《从前有座灵剑山》