复制代码代码如下:
<%@ page语言=“ java” import =“ java.util。*” pageencoding =“ utf-8”%>
<%
字符串路径= request.getContextPath();
字符串basepath = request.getScheme()+“://”+request.getServername()+“:”+request.getServerport()+path+path+“/”;
%>
<!doctype html公共” - // W3C // DTD HTML 4.01 Transitional // en>
<html>
<头>
<base href =“ <%= basepath%>”>
<title>我的JSP'checkbox.jsp'启动页</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 =“关键字” content =“ keyword1,keyword2,keyword3”>
<meta http-equiv =“描述” content =“这是我的页面”>
<script type =“ text/javascript” src =“ <%= request.getContextpath()%>/jquery/jquery-1.7.min.js”> </script>
<! -
<link rel =“ stylesheet” type =“ text/css” href =“ styles.css”>
- >
<脚本类型=“ text/javascript”>
$(function(){
// $(“#box”)。单击(function(){
// if($(“#box”)。attr(“检查”)==“检查”){
//警报(“ SS”);
//}
//})
if($(“#box”)。是(“:检查”)){
警报(“ DF”);
}
}))
</script>
</head>
<身体>
<input type =“复选框” id =“ box”检查=“检查”>
</body>
</html>