▶ board/read.jsp ( jQuery 사용 )
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<br>
<center>
<h3>READ PAGE</h3>
<table border=1 width=570>
<tr>
<td width=70>제목</td>
<td width=500>${boardVO.title }</td>
</tr>
<tr>
<td>내용</td>
<td>${boardVO.content }</td>
</tr>
<tr>
<td>작성자</td>
<td>${boardVO.writer }</td>
</tr>
</table>
<br>
<table border=0 width=570>
<tr>
<td width=50%><a href="listAll">[리스트]</a></td>
<td width=50% align="right">
<a href="/board/modify?bno=${boardVO.bno }">[수정]</a>
<a href="/board/remove?bno=${boardVO.bno }">[삭제]</a>
</td>
</tr>
</table>
<!-- jQuery 사용추가 -->
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.4.1.min.js"></script>
<form role="pkt" name="pkt" method="get">
<input type="hidden" name="bno" value="${boardVO.bno }">
</form>
<button class="btn-modify">수정</button>
<button class="btn-delete">삭제</button>
<button class="btn-list">리스트</button>
<script>
$(document).ready(function(){
var formObj = $("form[role='pkt']");
//console.log(formObj);
$(".btn-modify").on("click", function(){
formObj.attr("action", "/board/modify");
formObj.attr("method", "get");
formObj.submit();
});
$(".btn-delete").on("click", function(){
formObj.attr("action", "/board/remove");
formObj.attr("method", "get");
formObj.submit();
});
$(".btn-list").on("click", function(){
location.href="/board/listAll";
});
});
</script>
</center>
<br>
<%@ include file="/WEB-INF/views/include/footer.jsp" %>
- 이전글error_common.jsp 24.07.30
- 다음글● ⑤ 프레젠테이션(웹) 계층의 CRUD 구현 24.07.30
댓글목록
등록된 댓글이 없습니다.