<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#btn').click(function(){
//load함수 이용 - src.jsp 호출
//$("div#first").load("src.jsp");//요청파라미터 없이 내용 붙이기
//$("div#first").load("src.jsp","id=abc&pwd=111");//요청파라미터와 함께 내용붙이기(GET방식)
//$("div#first").load("src.jsp", {"id":"qerw","pwd":"555"});//요청파라미터 json형태로 내용붙이기(POST방식)
$("div#first").load("src.jsp","id=abc&pwd=111",function(data, status, xhr){
alert("응답완료");
alert("data : "+data);
alert("status : "+status);
alert("xhr관련 : "+xhr.readyState+" - "+xhr.status);
});//function 등록하기
});
});
</script>
</head>
<body>
<input type="button" value="클릭" id="btn">
<div id="first"></div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
response.setHeader("cache-control","no-cache");
%>
이것이 붙을 까요?<br>
${param.id}-${param.pwd}<br>
<%=request.getMethod() %><br>