-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathGood.jsp
More file actions
77 lines (77 loc) · 2.14 KB
/
Good.jsp
File metadata and controls
77 lines (77 loc) · 2.14 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<%--
Created by IntelliJ IDEA.
User: winph
Date: 8/6/2021
Time: 11:23 AM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Good</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
function SendVModel()
{
const v = {"id":"1","name":"John"};
// var v ={
// "id":"01",
// "name":"ali"
// }
$.ajax({
url: '/hey/save2/'+v,
type: 'GET',
data: JSON.stringify(v),
contentType: 'application/json; charset=utf-8',
dataType: 'json'
});
}
function SendVModel1()
{
const v = {"id":"1","name":"John"};
// var v ={
// "id":"01",
// "name":"ali"
// }
$.ajax({
url: '/hey/save3/'+v,
type: 'POST',
data: JSON.stringify(v),
contentType: 'application/json; charset=utf-8',
dataType: 'json'
});
}
function SendVModel2()
{
const v = {"id":"1","name":"John"};
// var v ={
// "id":"01",
// "name":"ali"
// }
$.ajax({
url: '/hey/save4/',
type: 'POST',
data: JSON.stringify(v),
contentType: 'application/json; charset=utf-8',
dataType: 'json'
});
}
function getClean()
{
$('#mname').val('');
$('#mid').val('');
}
</script>
</head>
<body style="background-color: cadetblue">
<input type="text" placeholder="id" id="mid">
<br>
<input type="text" placeholder="name" id="mname">
<br>
<a href="#" onclick="SendVModel();">sendSave2</a>
<a href="#" onclick="SendVModel1();">sendSave3</a>
<a href="#" onclick="SendVModel2();">sendSave4</a>
<br>
<a href="#" onclick="getClean();">clean</a>
</body>
</html>