웹 페이지의 전체 선택과 반대 선택
5973 단어 JavaScriptjsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
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> </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">
-->
<!-- Bootstrap -->
<link href="<%=basePath%>/boostrap/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
</div>
</div>
<div class="row clearfix">
<div class="col-md-12 column">
<c:choose>
<c:when test="${listNotexamined_info != null }">
<h3>
<c:out value="${listNotexamined_info }"></c:out>
</h3>
</c:when>
<c:otherwise>
<c:if test="${newsList != null && newsList.size() != 0 }">
<form action="root/publishAllNews" method="post">
<table class="table">
<thead>
<tr>
<!-- -->
<th><input name="checkAll" id="checkAll" type="checkbox" />
</th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th></th>
</tr>
</thead>
<tbody>
<c:forEach items="${newsList }" var="news">
<tr>
<!-- -->
<td><input name="newsId" type="checkbox"
value=<c:out value="${news.id }"/> /></td>
<!--
。。。。。。
-->
<td><button id="<c:out value="${news.id }"/>"
class="btn btn-default" onclick="publicNews(this)"> </button></td>
</tr>
</c:forEach>
</tbody>
</table>
<hr/>
<p align="right">
<input type="submit" value=" " class="btn btn-default" />
</p>
</form>
</c:if>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</body>
2 Js
$(function(){
//
$("#checkAll").click(function(){
var isChecked = $(this).prop("checked");
$("input[name='newsId']").prop("checked", isChecked);
});
});
3 백그라운드
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String[] newsIds = request.getParameterValues("newsId");
}
4인터페이스
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
기초 정리 - 1문자 (String) 숫자 (Number) 불린 (Boolean) null undefined 심볼 (Symbol) 큰정수 (BigInt) 따옴표로 묶어 있어야 함 Not-A-Number - 숫자 데이터 / 숫자로 표...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.