Skip to content

Commit

Permalink
jquery ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
kenu committed May 3, 2012
1 parent daabbbd commit 8c66694
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions gawibawibo/WebContent/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,25 @@
<meta charset="utf-8">
<title>가위 바위 보</title>
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
var send = function(e) {
$.post('query.jsp', { choice: this.value })
.success(function(data) {
$('#result').html(data);
});
};
$(function(){
$('form').bind('submit', function(e) {return false;});
$('button').click(send);
});
</script>
</head>
<body>
<jsp:include page="query.jsp"></jsp:include>
<div id="result"></div>
<jsp:include page="stat.jsp"></jsp:include>
<form method="post" onsubmit="return false">
<form method="post">
선택하세요:
<button name="choice" value="0">가위</button>
<button name="choice" value="1">바위</button>
Expand Down

0 comments on commit 8c66694

Please sign in to comment.