複製代碼代碼如下:
<%@ 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>