-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax 활용 1부터 100까지 합.js
More file actions
46 lines (31 loc) · 959 Bytes
/
ajax 활용 1부터 100까지 합.js
File metadata and controls
46 lines (31 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<input type="text" id="txtnum" name="txt1" size="10"><br><!-- 숫자입력 -->
<input type="text" id="txtresult" value="" size="10"><br><br><!-- 결과표시 -->
<input type="button" id="btnRun" value="결과보기">
</body>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script>
$(document)
.on('click','#btnRun',function(){
$.get("web06",
{txtnum:$('input[name=txt1]').val()},
function(txt){
alert(txt)
$('#txtresult').val(txt);
},
'text')
.fail(function (jqXHR, textStatus, errorThrown) {
if($.isNumeric( $('#txtnum').val())){
}
serrorFunction(); });
})
</script>
</html>